File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212from PIL import Image
1313from requests import codes
1414
15- from vws import VWS
15+ from vws import CloudRecoService , VWS
1616from vws .exceptions import (
1717 AuthenticationFailure ,
1818 BadImage ,
@@ -230,6 +230,16 @@ def test_authentication_failure(high_quality_image: io.BytesIO) -> None:
230230
231231 assert exc .value .response .status_code == codes .UNAUTHORIZED
232232
233+ cloud_reco_client = CloudRecoService (
234+ client_access_key = database .client_access_key ,
235+ client_secret_key = 'a' ,
236+ )
237+
238+ with pytest .raises (AuthenticationFailure ) as exc :
239+ cloud_reco_client .query (image = high_quality_image )
240+
241+ assert exc .value .response .status_code == codes .UNAUTHORIZED
242+
233243
234244def test_target_status_not_success (
235245 vws_client : VWS ,
Original file line number Diff line number Diff line change @@ -130,21 +130,6 @@ def test_too_many(
130130 )
131131 assert str (exc .value ) == expected_value
132132
133- class TestBadCredentials :
134- """
135- Tests for using bad credentials.
136- """
137-
138- def test_bad_credentials (self , high_quality_image : io .BytesIO ):
139- cloud_reco_client = CloudRecoService (
140- client_access_key = 'a' ,
141- client_secret_key = 'a' ,
142- )
143- with pytest .raises (AuthenticationFailure ) as exc :
144- cloud_reco_client .query (image = high_quality_image )
145-
146- assert exc .value .response .status_code == codes .UNAUTHORIZED
147-
148133
149134# TODO test custom base URL
150135# TODO test options - include_target_data
You can’t perform that action at this time.
0 commit comments