Skip to content

Commit b0098d2

Browse files
committed
Fix last missing coverage in main.py
1 parent e524772 commit b0098d2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/test_inverters.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ def test_post_inverters_for_site(client, sites, httpx_mock):
2727
assert response.json()["inverters"][0]["id"] == test_inverter_client_id
2828

2929

30+
def test_post_inverters_for_nonexistant_site(client, sites):
31+
nonexistant_site_uuid = "1cd11139-790a-46c0-8849-0c7c8e810ba5"
32+
test_inverter_client_id = "6c078ca2-2e75-40c8-9a7f-288bd0b70065"
33+
json = [test_inverter_client_id]
34+
response = client.post(f"/sites/{nonexistant_site_uuid}/inverters", json=json)
35+
assert response.status_code == 404
36+
37+
3038
def test_get_inverters_for_site_fake(client, sites, inverters, fake):
3139
response = client.get(f"/sites/{sites[0].site_uuid}/inverters")
3240
assert response.status_code == 200

0 commit comments

Comments
 (0)