File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,3 +226,29 @@ def test_empty_payload(rest_client):
226226 response = rest_client .post ("/us/tracer-analysis" , json = {})
227227 assert response .status_code == 400
228228 assert "No payload provided" in json .loads (response .data )["message" ]
229+
230+
231+ def test_null_payload (rest_client ):
232+ """Test that null payload is rejected"""
233+ response = rest_client .post (
234+ "/us/tracer-analysis" , data = "{}" , content_type = "application/json"
235+ )
236+ assert response .status_code == 400
237+ assert "No payload provided" in json .loads (response .data )["message" ]
238+
239+
240+ def test_validate_tracer_analysis_payload_failure (rest_client ):
241+ """Test handling of invalid payload from validate_tracer_analysis_payload"""
242+ response = rest_client .post (
243+ "/us/tracer-analysis" ,
244+ json = {
245+ # Missing required field 'variable'
246+ "household_id" : VALID_HOUSEHOLD_ID ,
247+ "policy_id" : VALID_POLICY_ID ,
248+ },
249+ )
250+ assert response .status_code == 400
251+ assert (
252+ "Missing required key: variable"
253+ in json .loads (response .data )["message" ]
254+ )
You can’t perform that action at this time.
0 commit comments