Commit f4f4404a authored by Eric Duminil's avatar Eric Duminil
Browse files

Adding tests to test_energy_grid

parent 4e529a78
...@@ -92,14 +92,25 @@ def test_energy_grid(): ...@@ -92,14 +92,25 @@ def test_energy_grid():
) )
kpis = to_dict(results.kpis) kpis = to_dict(results.kpis)
assert "PV potential yield" in kpis assert kpis["Number of buildings"].value == pytest.approx(5, abs=2)
assert "Roof area for PV" in kpis assert kpis["Number of buildings"].unit is None
assert kpis["PV potential yield"].value > 0 assert kpis["Number of households"].value == pytest.approx(10, abs=5)
assert kpis["PV potential nominal power"].value > 0 assert kpis["Number of households"].unit is None
assert kpis["PV potential nominal power"].unit == "kWp" assert kpis["Number of inhabitants"].value == pytest.approx(10, abs=5)
assert kpis["Irradiance in module plane"].unit == "W / m²" assert kpis["Number of inhabitants"].unit is None
assert kpis["Irradiance in module plane"].value == pytest.approx(150, abs=20) assert kpis["Total heated area"].value == pytest.approx(1200, abs=50)
assert kpis["PV specific yield"].unit == "kWh / (kWp · a)" assert kpis["Total heated area"].unit == "m²"
assert kpis["PV specific yield"].value == pytest.approx(1100, abs=100) assert kpis["Total electricity demand"].value == pytest.approx(17.0, abs=3)
assert kpis["Roof area for PV"].value > 100 assert kpis["Total electricity demand"].unit == "MWh / a"
assert kpis["Roof area for PV"].unit == "m²" assert kpis["Specific electricity demand"].value == pytest.approx(15, abs=5)
assert kpis["Specific electricity demand"].unit == "kWh / (m² · a)"
assert kpis["Total heat demand"].value == pytest.approx(125, abs=15)
assert kpis["Total heat demand"].unit == "MWh / a"
assert kpis["Specific heat demand"].value == pytest.approx(100, abs=15)
assert kpis["Specific heat demand"].unit == "kWh / (m² · a)"
assert kpis["Total PV production"].value == pytest.approx(30, abs=10)
assert kpis["Total PV production"].unit == "MWh / a"
assert kpis["Average temperature"].value == pytest.approx(10, abs=0.5)
assert kpis["Average temperature"].unit == "°C"
assert kpis["Most common archetype"].value == pytest.approx(70, abs=15)
assert kpis["Most common archetype"].unit == "% (QA_2)"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment