Added a few basic tests
This commit is contained in:
15
tests/conftest.py
Normal file
15
tests/conftest.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from os import environ
|
||||
|
||||
import pytest
|
||||
|
||||
from pyrmv import Client
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def api_token() -> str:
|
||||
return environ.get("RMV_TOKEN")
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def api_client(api_token: str) -> Client:
|
||||
return Client(api_token)
|
8
tests/test_client.py
Normal file
8
tests/test_client.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import pytest
|
||||
|
||||
from pyrmv import Client
|
||||
from pyrmv.classes import Stop
|
||||
|
||||
|
||||
def test_stop_by_name(api_client: Client):
|
||||
assert isinstance(api_client.stop_by_name("Hauptwache", max_number=1)[0], Stop)
|
7
tests/test_raw.py
Normal file
7
tests/test_raw.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from pyrmv.raw import stop_by_name
|
||||
|
||||
|
||||
def test_stop_by_name(api_token: str):
|
||||
assert isinstance(stop_by_name(api_token, "Hauptwache", maxNo=1), dict)
|
Reference in New Issue
Block a user