Skip to content

Commit

Permalink
fix(tests): change test as extra values are now permitted
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Feb 26, 2024
1 parent ef0536f commit 0b39393
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions tests/integration/study_data_blueprint/test_thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,31 +456,23 @@ def test_lifecycle(
assert res.status_code == 200, res.json()
assert res.json() == fr_gas_conventional_cfg

# Update with a pollutant. Should fail before v8.6 as it didn't exist.
# Update with a pollutant. Should succeed even with versions prior to v8.6
res = client.patch(
f"/v1/studies/{study_id}/areas/{area_id}/clusters/thermal/{fr_gas_conventional_id}",
headers={"Authorization": f"Bearer {user_access_token}"},
json={"nox": 10.0},
)
if version < 860:
assert res.status_code == 422
assert res.json()["exception"] == "ValidationError"
else:
assert res.status_code == 200
assert res.json()["nox"] == 10.0

# Update with the field `efficiency`. Should fail before v8.7 as it didn't exist.
assert res.status_code == 200
assert res.json()["nox"] == 10.0

# Update with the field `efficiency`. Should succeed even with versions prior to v8.7
res = client.patch(
f"/v1/studies/{study_id}/areas/{area_id}/clusters/thermal/{fr_gas_conventional_id}",
headers={"Authorization": f"Bearer {user_access_token}"},
json={"efficiency": 97.0},
)
if version < 870:
assert res.status_code == 422
assert res.json()["exception"] == "ValidationError"
else:
assert res.status_code == 200
assert res.json()["efficiency"] == 97.0
assert res.status_code == 200
assert res.json()["efficiency"] == 97.0

# =============================
# THERMAL CLUSTER DELETION
Expand Down

0 comments on commit 0b39393

Please sign in to comment.