diff --git a/tests/routers/test_lightning.py b/tests/routers/test_lightning.py index 752f131..0e6e1e0 100644 --- a/tests/routers/test_lightning.py +++ b/tests/routers/test_lightning.py @@ -1,14 +1,16 @@ from starlette.testclient import TestClient +from app.main import app from app.models.lightning import LightningInfoLite from app.routers import lightning +from tests.routers.test_lightning_utils import get_valid_lightning_info_lite from tests.routers.utils import call_route from tests.utils import monkeypatch_auth -from .test_lightning_utils import get_valid_lightning_info_lite +test_client = TestClient(app) -def test_route_authentications_latest(test_client: TestClient): +def test_route_authentications_latest(): prefixes = ["/latest/lightning", "/v1/lightning"] for prefix in prefixes: @@ -33,7 +35,7 @@ def test_route_authentications_latest(test_client: TestClient): call_route(test_client, f"{prefix}/unlock-wallet", params=p, method="p") -def test_get_ln_status(test_client: TestClient, monkeypatch): +def test_get_ln_status(monkeypatch): prefix_latest = "/latest/lightning" prefix_v1 = "/v1/lightning" diff --git a/tests/routers/test_lightning_utils.py b/tests/routers/test_lightning_utils.py index 3132bcc..ee3fd19 100644 --- a/tests/routers/test_lightning_utils.py +++ b/tests/routers/test_lightning_utils.py @@ -5,6 +5,7 @@ def get_valid_lightning_info_lite() -> LightningInfoLite: return LightningInfoLite( implementation="LND", version="0.13.1", + identity_pubkey="0246ad12eb40bcf26a0cd50757b15a58181d0ad0d78d5bc31e8058205321c3e632", num_pending_channels=1, num_active_channels=4, num_inactive_channels=2, diff --git a/tests/routers/test_system.py b/tests/routers/test_system.py index 33de6f4..800212e 100644 --- a/tests/routers/test_system.py +++ b/tests/routers/test_system.py @@ -1,10 +1,13 @@ from starlette.testclient import TestClient +from app.main import app from tests.routers.utils import call_route +client = TestClient(app) -def test_route_authentications_latest(test_client: TestClient): + +def test_route_authentications_latest(): prefixes = ["/latest/system", "/v1/system"] for prefix in prefixes: - call_route(test_client, f"{prefix}/refresh-token", method="p") + call_route(client, f"{prefix}/refresh-token", method="p") diff --git a/tests/test_conf.py b/tests/test_conf.py deleted file mode 100644 index 6c117e3..0000000 --- a/tests/test_conf.py +++ /dev/null @@ -1,10 +0,0 @@ -import pytest -from starlette.testclient import TestClient - -from app.main import app - - -@pytest.fixture(scope="module") -def test_client(): - client = TestClient(app) - yield client