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_http.py

38 lines
897 B
Python
Raw Normal View History

2023-01-13 16:23:27 +04:00
#!/usr/bin/env python3
import unittest
from python_aternos import Client
from tests import mock
class TestHttp(unittest.TestCase):
def test_basic(self) -> None:
with mock.mock:
at = Client.from_credentials('test', '')
# no exception = ok
def test_servers(self) -> None:
with mock.mock:
at = Client.from_credentials('test', '')
srvs = at.list_servers(cache=False)
self.assertTrue(srvs)
def test_status(self) -> None:
with mock.mock:
at = Client.from_credentials('test', '')
srv = at.list_servers(cache=False)[0]
self.assertEqual(
srv.subdomain,
'world35v',
)
self.assertEqual(
srv.is_java,
True,
)
if __name__ == '__main__':
unittest.main()