File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 11PyYAML == 3.13
22Pygments == 2.2.0
3- VWS-Python-Mock == 2018.10.01.1
3+ VWS-Python-Mock == 2018.10.02.0
44autoflake == 1.2
55check-manifest == 0.37
66codecov == 2.0.15 # Upload coverage data
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ def test_request_quota_reached() -> None:
9797
9898def test_fail (high_quality_image : io .BytesIO ) -> None :
9999 """
100- A ``Fail`` exception is raised when there are authentication issues .
100+ A ``Fail`` exception is raised when the server access key does not exist .
101101 """
102102 with MockVWS ():
103103 client = VWS (
@@ -201,3 +201,26 @@ def test_metadata_too_large(
201201 )
202202
203203 assert exc .value .response .status_code == codes .UNPROCESSABLE_ENTITY
204+
205+
206+ def test_authentication_failure (high_quality_image : io .BytesIO ) -> None :
207+ """
208+ An ``AuthenticationFailure`` exception is raised when the server access key
209+ does not exist.
210+ """
211+ database = VuforiaDatabase ()
212+ with MockVWS () as mock :
213+ mock .add_database (database = database )
214+ client = VWS (
215+ server_access_key = database .server_access_key .decode (),
216+ server_secret_key = 'a' ,
217+ )
218+
219+ with pytest .raises (AuthenticationFailure ) as exc :
220+ client .add_target (
221+ name = 'x' ,
222+ width = 1 ,
223+ image = high_quality_image ,
224+ )
225+
226+ assert exc .value .response .status_code == codes .UNAUTHORIZED
You can’t perform that action at this time.
0 commit comments