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")