@@ -22,6 +22,10 @@ def test_invalid_update_target(client) -> None:
2222 assert resp .status_code == 404
2323 data = resp .get_json ()
2424 assert data .get ("error" ) == "Invalid target"
25+ error_info = data .get ("error_info" , {})
26+ assert error_info .get ("status" ) == 404
27+ assert error_info .get ("message" ) == "Invalid target"
28+ assert isinstance (error_info .get ("remediation" ), str )
2529
2630
2731@pytest .mark .parametrize ("endpoint" , ["/unit_api/system/reboot" , "/unit_api/system/shutdown" ])
@@ -45,6 +49,10 @@ def test_get_clock_time_success(client) -> None:
4549def test_set_clock_non_leader (client ) -> None :
4650 resp = client .patch ("/unit_api/system/utc_clock" , json = {})
4751 assert resp .status_code == 400 # need to provide clock data, else it errors
52+ data = resp .get_json ()
53+ error_info = data .get ("error_info" , {})
54+ assert error_info .get ("status" ) == 400
55+ assert isinstance (error_info .get ("remediation" ), str )
4856
4957
5058def test_set_clock_time_sync_branch (client , monkeypatch ) -> None :
@@ -72,6 +80,10 @@ def test_hardware_check_requires_model_payload(client) -> None:
7280 assert resp .status_code == 400
7381 data = resp .get_json ()
7482 assert data ["error" ] == "Missing model_name or model_version"
83+ error_info = data .get ("error_info" , {})
84+ assert error_info .get ("status" ) == 400
85+ assert error_info .get ("message" ) == "Missing model_name or model_version"
86+ assert isinstance (error_info .get ("remediation" ), str )
7587
7688
7789def test_hardware_check_queues_task (client , monkeypatch ) -> None :
0 commit comments