Removed sensitive data from logging; 1 more test

This commit is contained in:
DarkCat09 2022-09-30 14:55:24 +04:00
parent 9ea8795bdb
commit 6b6e944d55
3 changed files with 36 additions and 9 deletions

View file

@ -1,4 +1,5 @@
import unittest
from typing import Optional
from python_aternos import Client
@ -9,6 +10,10 @@ AUTH_MD5 = '0efdb2cd6b36d5e54d0e3c161e567a4e'
class TestLogin(unittest.TestCase):
def setUp(self) -> None:
self.at: Optional[Client] = None
def test_md5(self) -> None:
self.assertEqual(
@ -18,22 +23,32 @@ class TestLogin(unittest.TestCase):
def test_auth(self) -> None:
at = Client.from_hashed(AUTH_USER, AUTH_MD5)
self.assertIsNotNone(at)
self.at = Client.from_hashed(AUTH_USER, AUTH_MD5)
self.assertIsNotNone(self.at)
def test_servers(self) -> None:
at = Client.from_hashed(
AUTH_USER, AUTH_MD5
)
if self.at is None:
self.at = Client.from_hashed(
AUTH_USER, AUTH_MD5
)
srvs = len(
at.list_servers(
self.at.list_servers(
cache=False
)
)
self.assertTrue(srvs > 0)
def test_logout(self) -> None:
if self.at is None:
self.at = Client.from_hashed(
AUTH_USER, AUTH_MD5
)
self.at.logout()
if __name__ == '__main__':
unittest.main()