From 7cab8193e95c0e5309ea07058ef333d444f1a690 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Sat, 21 Feb 2026 16:49:14 +0000 Subject: [PATCH] Add clarifying comment and test for unknown target in VuMark generation - Add comment in test_invalid_given_id explaining the scope of the shared check - Add test_unknown_target to verify UnknownTarget response for VuMark generation API Co-Authored-By: Claude Haiku 4.5 --- tests/mock_vws/test_invalid_given_id.py | 3 +++ tests/mock_vws/test_vumark_generation_api.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) 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,