File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55"""
66
77import datetime
8+ import sys
89import os
910import re
1011from mock import patch , Mock , MagicMock
@@ -1483,11 +1484,19 @@ def test_sha2_error(self, mock_request):
14831484 # ensure we're starting with the right values
14841485 self .sg .reset_user_agent ()
14851486
1486- # ensure the initial settings are correct
1487- self .assertFalse (self .sg .config .no_ssl_validation )
1488- self .assertFalse (shotgun_api3 .shotgun .NO_SSL_VALIDATION )
1489- self .assertTrue ("(validate)" in " " .join (self .sg ._user_agents ))
1490- self .assertFalse ("(no-validate)" in " " .join (self .sg ._user_agents ))
1487+ # ensure the initial settings are correct. These will be different depending on whether
1488+ # the ssl module imported successfully or not.
1489+ if "ssl" in sys .modules :
1490+ self .assertFalse (self .sg .config .no_ssl_validation )
1491+ self .assertFalse (shotgun_api3 .shotgun .NO_SSL_VALIDATION )
1492+ self .assertTrue ("(validate)" in " " .join (self .sg ._user_agents ))
1493+ self .assertFalse ("(no-validate)" in " " .join (self .sg ._user_agents ))
1494+ else :
1495+ self .assertTrue (self .sg .config .no_ssl_validation )
1496+ self .assertTrue (shotgun_api3 .shotgun .NO_SSL_VALIDATION )
1497+ self .assertFalse ("(validate)" in " " .join (self .sg ._user_agents ))
1498+ self .assertTrue ("(no-validate)" in " " .join (self .sg ._user_agents ))
1499+
14911500 try :
14921501 result = self .sg .info ()
14931502 except SSLHandshakeError :
You can’t perform that action at this time.
0 commit comments