Skip to content

Commit b7664c6

Browse files
Merge pull request #3225 from VWS-Python/cover-vws-exceptions
Cover imported exception classes
2 parents e2d95a8 + a26c8f9 commit b7664c6

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/vws/exceptions/custom_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class RecoCountsReportTimeoutError(Exception):
9090

9191

9292
@beartype
93-
class ServerError(Exception): # pragma: no cover
93+
class ServerError(Exception):
9494
"""Exception raised when VWS returns a server error."""
9595

9696
def __init__(self, response: Response) -> None:

src/vws/exceptions/vws_exceptions.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ def target_id(self) -> str:
8484
return _target_id_from_url(url=self.response.url)
8585

8686

87-
# This is not simulated by the mock.
8887
@beartype
89-
class DateRangeError(VWSError): # pragma: no cover
88+
class DateRangeError(VWSError):
9089
"""Exception raised when Vuforia returns a response with a result code
9190
'DateRangeError'.
9291
"""
@@ -171,16 +170,14 @@ def target_id(self) -> str:
171170

172171

173172
@beartype
174-
class TooManyRequestsError(VWSError): # pragma: no cover
173+
class TooManyRequestsError(VWSError):
175174
"""Exception raised when Vuforia returns a response with a result code
176175
'TooManyRequests'.
177176
"""
178177

179178

180-
# This is not simulated by client code because the accept parameter uses
181-
# the VuMarkAccept enum, which only allows valid values.
182179
@beartype
183-
class InvalidAcceptHeaderError(VWSError): # pragma: no cover
180+
class InvalidAcceptHeaderError(VWSError):
184181
"""Exception raised when Vuforia returns a response with a result code
185182
``InvalidAcceptHeader``.
186183
"""
@@ -193,10 +190,8 @@ class InvalidInstanceIdError(VWSError):
193190
"""
194191

195192

196-
# This is not simulated by client code because the request body
197-
# is always valid JSON when using this client.
198193
@beartype
199-
class BadRequestError(VWSError): # pragma: no cover
194+
class BadRequestError(VWSError):
200195
"""Exception raised when Vuforia returns a response with a result code
201196
``BadRequest``.
202197
"""

0 commit comments

Comments
 (0)