Skip to content

Commit c4dedbe

Browse files
committed
Fix tests
1 parent 55d86eb commit c4dedbe

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/vws/exceptions.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ def __init__(self, response: Response) -> None:
5050
self.response = response
5151

5252

53+
class AuthenticationFailure(Exception):
54+
"""
55+
Exception raised when Vuforia returns a response with a result code
56+
'AuthenticationFailure'.
57+
"""
58+
59+
def __init__(self, response: Response) -> None:
60+
"""
61+
Args:
62+
response: The response to a request to Vuforia.
63+
"""
64+
super().__init__()
65+
self.response = response
66+
67+
5368
class TargetStatusProcessing(Exception):
5469
"""
5570
Exception raised when Vuforia returns a response with a result code

src/vws/vws.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from vws._authorization import authorization_header, rfc_1123_date
1717
from vws.exceptions import (
18+
AuthenticationFailure,
1819
BadImage,
1920
Fail,
2021
ImageTooLarge,
@@ -102,6 +103,7 @@ def _raise_for_result_code(
102103
return
103104

104105
exception = {
106+
'AuthenticationFailure': AuthenticationFailure,
105107
'BadImage': BadImage,
106108
'Fail': Fail,
107109
'ImageTooLarge': ImageTooLarge,

tests/test_exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from vws import VWS
1616
from vws.exceptions import (
17+
AuthenticationFailure,
1718
BadImage,
1819
Fail,
1920
ImageTooLarge,

0 commit comments

Comments
 (0)