31
31
32
32
from shotgun_api3 .lib .httplib2 import Http
33
33
34
- # To mock the correct exception when testion on Python 2 and 3, use the
35
- # ShotgunSSLError variable from sgsix that contains the appropriate exception
36
- # class for the current Python version.
37
- from shotgun_api3 .lib .sgsix import ShotgunSSLError
38
-
39
34
import shotgun_api3
40
35
41
36
from . import base
@@ -2258,7 +2253,7 @@ def my_side_effect2(*args, **kwargs):
2258
2253
@unittest .mock .patch ("shotgun_api3.shotgun.Http.request" )
2259
2254
def test_sha2_error (self , mock_request ):
2260
2255
# Simulate the exception raised with SHA-2 errors
2261
- mock_request .side_effect = ShotgunSSLError (
2256
+ mock_request .side_effect = ssl . SSLError (
2262
2257
"[Errno 1] _ssl.c:480: error:0D0C50A1:asn1 "
2263
2258
"encoding routines:ASN1_item_verify: unknown message digest "
2264
2259
"algorithm"
@@ -2285,7 +2280,7 @@ def test_sha2_error(self, mock_request):
2285
2280
2286
2281
try :
2287
2282
self .sg .info ()
2288
- except ShotgunSSLError :
2283
+ except ssl . SSLError :
2289
2284
# ensure the api has reset the values in the correct fallback behavior
2290
2285
self .assertTrue (self .sg .config .no_ssl_validation )
2291
2286
self .assertTrue (shotgun_api3 .shotgun .NO_SSL_VALIDATION )
@@ -2298,7 +2293,7 @@ def test_sha2_error(self, mock_request):
2298
2293
@unittest .mock .patch ("shotgun_api3.shotgun.Http.request" )
2299
2294
def test_sha2_error_with_strict (self , mock_request ):
2300
2295
# Simulate the exception raised with SHA-2 errors
2301
- mock_request .side_effect = ShotgunSSLError (
2296
+ mock_request .side_effect = ssl . SSLError (
2302
2297
"[Errno 1] _ssl.c:480: error:0D0C50A1:asn1 "
2303
2298
"encoding routines:ASN1_item_verify: unknown message digest "
2304
2299
"algorithm"
@@ -2315,7 +2310,7 @@ def test_sha2_error_with_strict(self, mock_request):
2315
2310
2316
2311
try :
2317
2312
self .sg .info ()
2318
- except ShotgunSSLError :
2313
+ except ssl . SSLError :
2319
2314
# ensure the api has NOT reset the values in the fallback behavior because we have
2320
2315
# set the env variable to force validation
2321
2316
self .assertFalse (self .sg .config .no_ssl_validation )
0 commit comments