diff --git a/tests/test_inverters.py b/tests/test_inverters.py index ef29812..3f70956 100644 --- a/tests/test_inverters.py +++ b/tests/test_inverters.py @@ -27,6 +27,14 @@ def test_post_inverters_for_site(client, sites, httpx_mock): assert response.json()["inverters"][0]["id"] == test_inverter_client_id +def test_post_inverters_for_nonexistant_site(client, sites): + nonexistant_site_uuid = "1cd11139-790a-46c0-8849-0c7c8e810ba5" + test_inverter_client_id = "6c078ca2-2e75-40c8-9a7f-288bd0b70065" + json = [test_inverter_client_id] + response = client.post(f"/sites/{nonexistant_site_uuid}/inverters", json=json) + assert response.status_code == 404 + + def test_get_inverters_for_site_fake(client, sites, inverters, fake): response = client.get(f"/sites/{sites[0].site_uuid}/inverters") assert response.status_code == 200