Skip to content

Commit 337ee04

Browse files
adamtheturtleclaude
andcommitted
Map only the documented ProjectHasNoApiAccess casing
Vuforia does not document the ProjectHasNoAPIAccess casing, so drop it from the result code map rather than keeping it as an alias. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 43680f5 commit 337ee04

4 files changed

Lines changed: 8 additions & 21 deletions

File tree

newsfragments/3128.change.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Map the ``ProjectHasNoApiAccess`` result code, as spelled in Vuforia's result codes table, to ``ProjectHasNoAPIAccessError``. The previously mapped ``ProjectHasNoAPIAccess`` casing still raises the same exception.
1+
Map the ``ProjectHasNoApiAccess`` result code, as spelled in Vuforia's result codes table, to ``ProjectHasNoAPIAccessError``. The previously mapped ``ProjectHasNoAPIAccess`` casing, which Vuforia does not document, is no longer mapped.

spelling_private_dict.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ MaxNumResultsOutOfRange
1313
MetadataTooLarge
1414
OopsAnErrorOccurredPossiblyBadName
1515
OopsAnErrorOccurredPossiblyBadNameError
16-
ProjectHasNoAPIAccess
1716
ProjectHasNoApiAccess
1817
ProjectInactive
1918
ProjectSuspended

src/vws/exceptions/vws_exceptions.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ class ProjectSuspendedError(VWSError):
110110
class ProjectHasNoAPIAccessError(VWSError):
111111
"""Exception raised when Vuforia returns a response with a result code
112112
'ProjectHasNoApiAccess'.
113-
114-
Vuforia's result codes table spells this result code
115-
'ProjectHasNoApiAccess', but no real response with either casing has
116-
been observed, so 'ProjectHasNoAPIAccess' raises this exception too.
117113
"""
118114

119115

@@ -245,11 +241,9 @@ class AuthorizationFailedError(VWSError):
245241
"InvalidTargetType": InvalidTargetTypeError,
246242
"LicenseCheckFailed": LicenseCheckFailedError,
247243
"MetadataTooLarge": MetadataTooLargeError,
248-
# Vuforia's result codes table spells this ``ProjectHasNoApiAccess``.
249-
# ``ProjectHasNoAPIAccess`` was mapped first, from a hand-written list
250-
# rather than an observed response. No real response with either
251-
# casing has been observed, so both are mapped.
252-
"ProjectHasNoAPIAccess": ProjectHasNoAPIAccessError,
244+
# This casing comes from Vuforia's result codes table. No real
245+
# response with this result code has been observed, with this or any
246+
# other casing.
253247
"ProjectHasNoApiAccess": ProjectHasNoAPIAccessError,
254248
"ProjectInactive": ProjectInactiveError,
255249
"ProjectSuspended": ProjectSuspendedError,

tests/test_vws_exceptions.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -583,17 +583,11 @@ def test_vwserror_from_result_code() -> None:
583583
assert exception.response is response
584584

585585

586-
@pytest.mark.parametrize(
587-
argnames="result_code",
588-
argvalues=["ProjectHasNoApiAccess", "ProjectHasNoAPIAccess"],
589-
)
590-
def test_project_has_no_api_access_casings(result_code: str) -> None:
591-
"""Both casings of the ``ProjectHasNoApiAccess`` result code map to
592-
``ProjectHasNoAPIAccessError``.
593-
594-
Vuforia's result codes table uses ``ProjectHasNoApiAccess``, but no
595-
real response with either casing has been observed.
586+
def test_project_has_no_api_access_casing() -> None:
587+
"""The ``ProjectHasNoApiAccess`` result code, as spelled in Vuforia's
588+
result codes table, maps to ``ProjectHasNoAPIAccessError``.
596589
"""
590+
result_code = "ProjectHasNoApiAccess"
597591
response = Response(
598592
text=f'{{"result_code":"{result_code}"}}',
599593
url="https://example.com/targets",

0 commit comments

Comments
 (0)