diff --git a/src/tests/gateway/test_handle_upload.py b/src/tests/gateway/test_handle_upload.py index 7dfd9aa..7ee1c8e 100644 --- a/src/tests/gateway/test_handle_upload.py +++ b/src/tests/gateway/test_handle_upload.py @@ -54,3 +54,30 @@ def test_invalid_message( print(f"{resp_str=}") assert resp_str.startswith("FAIL: JSON parsing: ") + + +def test_outdated_schema( + fix_sys_path, + eddn_message: Callable, + eddn_gateway, + bottle_response +) -> None: + """Test eddn.Gateway with an invalid message.""" + #################################################################### + # Mock a bottle 'response' enough to accept setting status + #################################################################### + class BottleResponseMock: + status: int = 200 + #################################################################### + + msg = eddn_message("plain_outdated_schema") + resp_str = eddn_gateway.handle_upload( + headers={ + "Content-Type": "application/json" + }, + body=msg.encode(encoding="utf-8"), + response=bottle_response + ) + + print(f"{resp_str=}") + assert resp_str.startswith("FAIL: Outdated Schema: ")