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
@@ -2260,7 +2255,7 @@ def my_side_effect2(*args, **kwargs):
2260
2255
@unittest .mock .patch ("shotgun_api3.shotgun.Http.request" )
2261
2256
def test_sha2_error (self , mock_request ):
2262
2257
# Simulate the exception raised with SHA-2 errors
2263
- mock_request .side_effect = ShotgunSSLError (
2258
+ mock_request .side_effect = ssl . SSLError (
2264
2259
"[Errno 1] _ssl.c:480: error:0D0C50A1:asn1 "
2265
2260
"encoding routines:ASN1_item_verify: unknown message digest "
2266
2261
"algorithm"
@@ -2287,7 +2282,7 @@ def test_sha2_error(self, mock_request):
2287
2282
2288
2283
try :
2289
2284
self .sg .info ()
2290
- except ShotgunSSLError :
2285
+ except ssl . SSLError :
2291
2286
# ensure the api has reset the values in the correct fallback behavior
2292
2287
self .assertTrue (self .sg .config .no_ssl_validation )
2293
2288
self .assertTrue (shotgun_api3 .shotgun .NO_SSL_VALIDATION )
@@ -2300,7 +2295,7 @@ def test_sha2_error(self, mock_request):
2300
2295
@unittest .mock .patch ("shotgun_api3.shotgun.Http.request" )
2301
2296
def test_sha2_error_with_strict (self , mock_request ):
2302
2297
# Simulate the exception raised with SHA-2 errors
2303
- mock_request .side_effect = ShotgunSSLError (
2298
+ mock_request .side_effect = ssl . SSLError (
2304
2299
"[Errno 1] _ssl.c:480: error:0D0C50A1:asn1 "
2305
2300
"encoding routines:ASN1_item_verify: unknown message digest "
2306
2301
"algorithm"
@@ -2317,7 +2312,7 @@ def test_sha2_error_with_strict(self, mock_request):
2317
2312
2318
2313
try :
2319
2314
self .sg .info ()
2320
- except ShotgunSSLError :
2315
+ except ssl . SSLError :
2321
2316
# ensure the api has NOT reset the values in the fallback behavior because we have
2322
2317
# set the env variable to force validation
2323
2318
self .assertFalse (self .sg .config .no_ssl_validation )
0 commit comments