Skip to content

Commit 8c27e0b

Browse files
committed
Added tests to cover the code at line 39 in the tracer_analysis_routes.py file.
1 parent 6fde5cb commit 8c27e0b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/to_refactor/python/test_tracer_analysis_routes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,16 @@ def test_empty_payload(rest_client):
214214
assert "No payload provided" in json.loads(response.data)["message"]
215215

216216

217+
def test_invalid_content_type(rest_client):
218+
"""Test that non-JSON content type is rejected"""
219+
response = rest_client.post(
220+
"/us/tracer-analysis",
221+
data="some data",
222+
content_type="text/plain", # Invalid content type
223+
)
224+
assert response.status_code == 415
225+
226+
217227
def test_validate_tracer_analysis_payload_failure(rest_client):
218228
"""Test handling of invalid payload from validate_tracer_analysis_payload"""
219229
response = rest_client.post(

0 commit comments

Comments
 (0)