Refactor tests and start work on database integration.

This commit is contained in:
grossmj
2020-12-02 18:39:08 +10:30
parent ae55c0ec9c
commit bf7cf862af
69 changed files with 2955 additions and 1877 deletions

View File

@ -17,10 +17,14 @@
import pytest
from fastapi import FastAPI, status
from httpx import AsyncClient
@pytest.mark.asyncio
async def test_appliances_list(controller_api):
pytestmark = pytest.mark.asyncio
response = await controller_api.get("/appliances/")
assert response.status_code == 200
assert len(response.json) > 0
async def test_appliances_list(app: FastAPI, client: AsyncClient) -> None:
response = await client.get(app.url_path_for("get_appliances"))
assert response.status_code == status.HTTP_200_OK
assert len(response.json()) > 0