diff --git a/tests/mock_vws/test_invalid_given_id.py b/tests/mock_vws/test_invalid_given_id.py index 067867f75..9db6c8cac 100644 --- a/tests/mock_vws/test_invalid_given_id.py +++ b/tests/mock_vws/test_invalid_given_id.py @@ -34,6 +34,9 @@ def test_not_real_id( target ID of a target which does not exist. """ + # This shared check only covers endpoints that end in target_id, + # such as /targets/{target_id}. Endpoints with trailing segments + # are covered by endpoint-specific tests. if not endpoint.path_url.endswith(target_id): return diff --git a/tests/mock_vws/test_vumark_generation_api.py b/tests/mock_vws/test_vumark_generation_api.py index e529bd479..8705713ce 100644 --- a/tests/mock_vws/test_vumark_generation_api.py +++ b/tests/mock_vws/test_vumark_generation_api.py @@ -195,6 +195,23 @@ def test_empty_instance_id( == ResultCodes.INVALID_INSTANCE_ID.value ) + @staticmethod + def test_unknown_target( + vumark_vuforia_database: VuMarkCloudDatabase, + ) -> None: + """An unknown target_id returns UnknownTarget.""" + response = _make_vumark_request( + server_access_key=vumark_vuforia_database.server_access_key, + server_secret_key=vumark_vuforia_database.server_secret_key, + target_id=uuid4().hex, + instance_id=uuid4().hex, + accept=VuMarkAccept.PNG, + ) + + assert response.status_code == HTTPStatus.NOT_FOUND + response_json = response.json() + assert response_json["result_code"] == ResultCodes.UNKNOWN_TARGET.value + @staticmethod def test_non_vumark_database( vuforia_database: CloudDatabase,