From 4f793b89902a9b4fb8d6ec29c335ace82d418330 Mon Sep 17 00:00:00 2001 From: "Evgeny (Krymmy) Momotov" Date: Thu, 25 Sep 2025 13:01:31 +0300 Subject: [PATCH] [TEST] test_login.py --- tests/test_login.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/test_login.py 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