diff --git a/tests/test_login.py b/tests/test_login.py new file mode 100644 index 0000000..6a98836 --- /dev/null +++ b/tests/test_login.py @@ -0,0 +1,21 @@ +import asyncio + +import pytest +from TaxisLibrary.taxis_client import TaxisClient, ApiKeyOut + + +@pytest.fixture +def client(): + return TaxisClient("http://127.0.0.1:7000") + +class TestLogin: + + @pytest.mark.asyncio + async def test_login(self, client): + result = await client.login(username="root", password="12345") + assert isinstance(result, ApiKeyOut) + + @pytest.mark.asyncio + async def test_login_error(self, client): + with pytest.raises(Exception): + await client.login(username="root", password="123456") \ No newline at end of file