-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_linegraph.py
More file actions
27 lines (22 loc) · 789 Bytes
/
Copy pathtest_linegraph.py
File metadata and controls
27 lines (22 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pytest
from httpx import AsyncClient
from main import app
@pytest.mark.asyncio(scope='session')
async def test_maps():
async with AsyncClient(app=app, base_url="http://localhost") as ac:
response = await ac.get(
"/api/line-graph?fields="
"index,Normalised_Gas_boiler_heat,"
"Normalised_Resistance_heater_heat,"
"Normalised_ASHP_heat,Normalised_GSHP_heat"
)
assert response.status_code == 200
json = response.json()
assert json["columns"] == [
"index",
"Normalised_Gas_boiler_heat",
"Normalised_Resistance_heater_heat",
"Normalised_ASHP_heat",
"Normalised_GSHP_heat"
]
assert json["minmax"] == [0.0, 251.4635]