Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
999d92d
Import order
julien-lang Jul 16, 2025
9777db0
Remove __future__ imports
julien-lang Jul 16, 2025
e3e72cd
Cleanup super prototype
julien-lang Jul 16, 2025
2e3b54b
six.iter....
julien-lang Jul 16, 2025
64fa354
Remove calls to six.text_type and six.binary_type
julien-lang Jul 16, 2025
d014745
Remove calls to ensure_bytes, ensure_text, ensure_strings
julien-lang Jul 16, 2025
153f179
test fixed
eduardoChaucaGallegos Jul 17, 2025
2de2822
fixup! test fixed
julien-lang Jul 17, 2025
24835e3
Black
julien-lang Jul 17, 2025
60bb0bc
Update shotgun_api3/shotgun.py
julien-lang Jul 17, 2025
473b811
six.moves imports
julien-lang Jul 16, 2025
f68f1ae
Cleanup BytesIO import from six
julien-lang Jul 16, 2025
0b956cc
simple json
julien-lang Jul 16, 2025
b94da1a
Cleanup Py2-3 compat with ImportError
julien-lang Jul 16, 2025
6e89b98
Simplify Base64
julien-lang Jul 16, 2025
439d0b3
fixup! six.moves imports
julien-lang Jul 17, 2025
adbc0da
fixup! six.moves imports
julien-lang Jul 17, 2025
c4d1e30
Remove deprecated custome mimetype module
julien-lang Jul 16, 2025
e93ed1e
Remove deprecated backported mock module
julien-lang Jul 16, 2025
12f1abe
Fixup assert_called_once
julien-lang Jul 17, 2025
ea953d2
Fixup CI tests
julien-lang Jul 17, 2025
f45faac
fixup! Fixup CI tests
julien-lang Jul 17, 2025
6a2b3e2
provides debug info
julien-lang Jul 17, 2025
cb800c1
fixup! provides debug info
julien-lang Jul 17, 2025
a4afffa
fixup! Remove deprecated backported mock module
julien-lang Jul 17, 2025
50c7c49
pull from master and fixed conflicts
eduardoChaucaGallegos Sep 10, 2025
6cc966f
conflicts on test_api.py fixed
eduardoChaucaGallegos Sep 10, 2025
69a5092
fixed conflicts
eduardoChaucaGallegos Sep 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

[flake8]
max-line-length = 120
exclude = shotgun_api3/lib/httplib2/*,shotgun_api3/lib/six.py,tests/httplib2test.py,tests/mock.py
exclude = shotgun_api3/lib/httplib2/*,shotgun_api3/lib/six.py,tests/httplib2test.py
13 changes: 6 additions & 7 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import re
import time
import unittest
import unittest.mock
import urllib.error

from . import mock

import shotgun_api3 as api
from shotgun_api3.shotgun import ServerCapabilities
from shotgun_api3.lib import six
Expand Down Expand Up @@ -133,12 +132,12 @@ def _setup_mock(self, s3_status_code_error=503):
"""Setup mocking on the ShotgunClient to stop it calling a live server"""
# Replace the function used to make the final call to the server
# eaiser than mocking the http connection + response
self.sg._http_request = mock.Mock(
self.sg._http_request = unittest.mock.Mock(
spec=api.Shotgun._http_request, return_value=((200, "OK"), {}, None)
)
# Replace the function used to make the final call to the S3 server, and simulate
# the exception HTTPError raised with 503 status errors
self.sg._make_upload_request = mock.Mock(
self.sg._make_upload_request = unittest.mock.Mock(
spec=api.Shotgun._make_upload_request,
side_effect=urllib.error.HTTPError(
"url",
Expand All @@ -152,12 +151,12 @@ def _setup_mock(self, s3_status_code_error=503):
# also replace the function that is called to get the http connection
# to avoid calling the server. OK to return a mock as we will not use
# it
self.mock_conn = mock.Mock(spec=api.lib.httplib2.Http)
self.mock_conn = unittest.mock.Mock(spec=api.lib.httplib2.Http)
# The Http objects connection property is a dict of connections
# it is holding
self.mock_conn.connections = dict()
self.sg._connection = self.mock_conn
self.sg._get_connection = mock.Mock(return_value=self.mock_conn)
self.sg._get_connection = unittest.mock.Mock(return_value=self.mock_conn)

# create the server caps directly to say we have the correct version
self.sg._server_caps = ServerCapabilities(
Expand All @@ -173,7 +172,7 @@ def _mock_http(self, data, headers=None, status=None):
"""
# test for a mock object rather than config.mock as some tests
# force the mock to be created
if not isinstance(self.sg._http_request, mock.Mock):
if not isinstance(self.sg._http_request, unittest.mock.Mock):
return

if not isinstance(data, str):
Expand Down
Loading