generated from Luis/nextjs-python-web-template
Trying to fix attach entity #44
@@ -12,6 +12,7 @@ from openapi_client import ApiClient, Configuration
|
|||||||
|
|
||||||
from clan_cli.webui.app import app
|
from clan_cli.webui.app import app
|
||||||
|
|
||||||
|
from ports import PortFunction
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def test_client() -> TestClient:
|
def test_client() -> TestClient:
|
||||||
@@ -31,8 +32,8 @@ def get_health(*, url: str, max_retries: int = 20, delay: float = 0.2) -> str |
|
|||||||
|
|
||||||
# Pytest fixture to run the server in a separate process
|
# Pytest fixture to run the server in a separate process
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def server_url() -> Generator[str, None, None]:
|
def server_url(unused_tcp_port: PortFunction) -> Generator[str, None, None]:
|
||||||
port = 8000
|
port = unused_tcp_port()
|
||||||
host = "127.0.0.1"
|
host = "127.0.0.1"
|
||||||
proc = Process(
|
proc = Process(
|
||||||
target=uvicorn.run,
|
target=uvicorn.run,
|
||||||
|
|||||||
@@ -26,12 +26,6 @@ def test_health(api_client: ApiClient) -> None:
|
|||||||
assert res.status == Status.ONLINE
|
assert res.status == Status.ONLINE
|
||||||
|
|
||||||
|
|
||||||
def test_entities_empty(api_client: ApiClient) -> None:
|
|
||||||
entity = EntitiesApi(api_client=api_client)
|
|
||||||
res = entity.get_all_entities()
|
|
||||||
assert res == []
|
|
||||||
|
|
||||||
|
|
||||||
def create_entities(num: int = 10) -> list[EntityCreate]:
|
def create_entities(num: int = 10) -> list[EntityCreate]:
|
||||||
res = []
|
res = []
|
||||||
for i in range(num):
|
for i in range(num):
|
||||||
|
|||||||
Reference in New Issue
Block a user