Skip to content

Commit 99d3a1e

Browse files
committed
fixup! More SSL cleanups
1 parent 74a0494 commit 99d3a1e

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

shotgun_api3/shotgun.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,9 +2246,9 @@ def reset_user_agent(self):
22462246

22472247
# create ssl validation string based on settings
22482248
self._user_agents = [
2249-
f"shotgun-json ({__version__})",
2250-
f"Python {self.client_caps.py_version} ({ua_platform})",
2251-
f"ssl {self.client_caps.ssl_version}",
2249+
"shotgun-json (%s)" % __version__,
2250+
"Python %s (%s)" % (self.client_caps.py_version, ua_platform),
2251+
"ssl %s" % (self.client_caps.ssl_version),
22522252
]
22532253

22542254
def set_session_uuid(self, session_uuid):

tests/test_api.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ def test_upload_to_sg(self, mock_send_form):
288288
"attachments",
289289
tag_list="monkeys, everywhere, send, help",
290290
)
291-
<<<<<<< HEAD
292-
=======
293-
294-
>>>>>>> 413afc6 (SSL)
295291
mock_send_form.assert_called_once()
296292
mock_send_form_args, _ = mock_send_form.call_args
297293
display_name_to_send = mock_send_form_args[1].get("display_name", "")
@@ -315,11 +311,7 @@ def test_upload_to_sg(self, mock_send_form):
315311
display_name_to_send.startswith("b'") and display_name_to_send.endswith("'")
316312
)
317313

318-
<<<<<<< HEAD
319314
mock_send_form.reset_mock()
320-
=======
321-
# mock_send_form.method.assert_called_once() ## CANOT work because was already called earlier....
322-
>>>>>>> 413afc6 (SSL)
323315
mock_send_form.return_value = "2\nIt can't be upload"
324316
self.assertRaises(
325317
shotgun_api3.ShotgunError,
@@ -701,10 +693,6 @@ def test_share_thumbnail_not_ready(self, mock_send_form):
701693
def test_share_thumbnail_returns_error(self, mock_send_form):
702694
"""throw an exception if server returns an error code"""
703695

704-
<<<<<<< HEAD
705-
=======
706-
# mock_send_form.method.assert_called_once() # never worked.....
707-
>>>>>>> 413afc6 (SSL)
708696
mock_send_form.return_value = "1\nerror message.\n"
709697

710698
self.assertRaises(
@@ -2260,7 +2248,7 @@ def my_side_effect2(*args, **kwargs):
22602248
finally:
22612249
self.sg.config.rpc_attempt_interval = bak_rpc_attempt_interval
22622250

2263-
@unittest.mock.patch.object(urllib.request.OpenerDirector, 'open')
2251+
@unittest.mock.patch.object(urllib.request.OpenerDirector, "open")
22642252
def test_sanitized_auth_params(self, mock_open):
22652253
# Simulate the server blowing up and giving us a 500 error
22662254
mock_open.side_effect = urllib.error.HTTPError("url", 500, "message", {}, None)

tests/test_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
import shotgun_api3.lib.httplib2 as httplib2
3030
import shotgun_api3 as api
3131
from shotgun_api3.shotgun import ServerCapabilities, SG_TIMEZONE
32-
import shotgun_api3 as api
33-
import shotgun_api3.lib.httplib2 as httplib2
3432

3533

3634
def b64encode(val):

0 commit comments

Comments
 (0)