This repository has been archived on 2024-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
python-aternos/tests/test_login.py

31 lines
620 B
Python
Raw Normal View History

import unittest
from python_aternos import Client
AUTH_USER = 'world35g'
AUTH_PSWD = 'world35g'
AUTH_MD5 = '0efdb2cd6b36d5e54d0e3c161e567a4e'
class TestLogin(unittest.TestCase):
def test_md5(self) -> None:
self.assertEqual(
Client.md5encode(AUTH_PSWD),
AUTH_MD5
)
def test_auth(self) -> None:
at = Client.from_hashed(AUTH_USER, AUTH_MD5)
self.assertIsNotNone(at)
def test_servers(self) -> None:
at = Client.from_hashed(
AUTH_USER, AUTH_MD5
)
srvs = len(at.list_servers())
self.assertTrue(srvs > 0)