Skip to content

Commit 0c56b26

Browse files
adamtheturtleclaude
andcommitted
Fix inactive VuMark database to return UnknownTarget (404) not ProjectInactive
Real Vuforia returns 404 UnknownTarget for inactive VuMark databases on the generation endpoint, not 403 ProjectInactive. Skip the project-inactive check for VuMarkDatabase so target validation runs and returns the correct response. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f54a377 commit 0c56b26

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/mock_vws/_services_validators/project_state_validators.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
get_database_matching_server_keys,
1212
)
1313
from mock_vws._services_validators.exceptions import ProjectInactiveError
14-
from mock_vws.database import CloudDatabase
14+
from mock_vws.database import CloudDatabase, VuMarkDatabase
1515
from mock_vws.states import States
1616

1717
_LOGGER = logging.getLogger(name=__name__)
@@ -57,5 +57,8 @@ def validate_project_state(
5757
):
5858
return
5959

60+
if isinstance(database, VuMarkDatabase):
61+
return
62+
6063
_LOGGER.warning(msg="The project is inactive.")
6164
raise ProjectInactiveError

tests/mock_vws/test_vumark_generation_api.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,6 @@ def test_inactive_database(
365365
accept="image/png",
366366
)
367367

368-
assert response.status_code == HTTPStatus.FORBIDDEN
368+
assert response.status_code == HTTPStatus.NOT_FOUND
369369
response_json = response.json()
370-
assert (
371-
response_json["result_code"] == ResultCodes.PROJECT_INACTIVE.value
372-
)
370+
assert response_json["result_code"] == ResultCodes.UNKNOWN_TARGET.value

0 commit comments

Comments
 (0)