[TEST] test_login.py
This commit is contained in:
parent
f7c189c46f
commit
4f793b8990
1 changed files with 21 additions and 0 deletions
21
tests/test_login.py
Normal file
21
tests/test_login.py
Normal file
|
|
@ -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")
|
||||||
Loading…
Add table
Reference in a new issue