Skip to content

Commit 88f8ec1

Browse files
committed
autopep8 --in-place --select=F401,W291 ./tests/*.py ./shotgun_api3/shotgun.py ./shotgun_api3/lib/*.py
1 parent fdda095 commit 88f8ec1

File tree

9 files changed

+105
-105
lines changed

9 files changed

+105
-105
lines changed

shotgun_api3/lib/sgtimezone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /opt/local/bin/python
22
# ----------------------------------------------------------------------------
33
# SG_TIMEZONE module
4-
# this is rolled into the this shotgun api file to avoid having to require
4+
# this is rolled into the this shotgun api file to avoid having to require
55
# current users of api2 to install new modules and modify PYTHONPATH info.
66
# ----------------------------------------------------------------------------
77

@@ -23,7 +23,7 @@ class SgTimezone(object):
2323
DSTOFFSET = STDOFFSET
2424
DSTDIFF = DSTOFFSET - STDOFFSET
2525

26-
def __init__(self):
26+
def __init__(self):
2727
self.utc = UTC()
2828
self.local = LocalTimezone()
2929

tests/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def setUp(self, auth_mode='ApiUser'):
6060
http_proxy=self.config.http_proxy,
6161
connect=self.connect )
6262
elif auth_mode == 'SessionToken':
63-
# first make an instance based on script key/name so
63+
# first make an instance based on script key/name so
6464
# we can generate a session token
6565
sg = api.Shotgun(self.config.server_url,
6666
self.config.script_name,
@@ -307,8 +307,8 @@ def __init__(self):
307307
def config_keys(self):
308308
return [
309309
'api_key', 'asset_code', 'http_proxy', 'human_login', 'human_name',
310-
'human_password', 'mock', 'project_name', 'script_name',
311-
'server_url', 'session_uuid', 'shot_code', 'task_content',
310+
'human_password', 'mock', 'project_name', 'script_name',
311+
'server_url', 'session_uuid', 'shot_code', 'task_content',
312312
'version_code', 'playlist_code'
313313
]
314314

tests/dummy_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dummy data returned for schema functions when mocking the server.
22
3-
NOTE: Mostly abbreviated version of real data returned from the server.
3+
NOTE: Mostly abbreviated version of real data returned from the server.
44
"""
55

66
schema_entity_read = {'Version': {'name': {'editable': False, 'value': 'Version'}}}
@@ -873,4 +873,4 @@
873873
'valid_types': {'editable': True,
874874
'value': ['HumanUser',
875875
'ApiUser']}}}}
876-
876+

tests/httplib2test.py

Lines changed: 50 additions & 50 deletions
Large diffs are not rendered by default.

tests/test_api.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,18 +1543,18 @@ def test_following(self):
15431543
[["id","is",self.task["id"]]],
15441544
["project.Project.id"])["project.Project.id"]
15451545
project_count = 2 if shot_project_id == task_project_id else 1
1546-
result = self.sg.following(self.human_user,
1546+
result = self.sg.following(self.human_user,
15471547
project={"type":"Project", "id":shot_project_id})
15481548
self.assertEqual( project_count, len(result) )
1549-
result = self.sg.following(self.human_user,
1549+
result = self.sg.following(self.human_user,
15501550
project={"type":"Project", "id":task_project_id})
15511551
self.assertEqual( project_count, len(result) )
1552-
result = self.sg.following(self.human_user,
1553-
project={"type":"Project", "id":shot_project_id},
1552+
result = self.sg.following(self.human_user,
1553+
project={"type":"Project", "id":shot_project_id},
15541554
entity_type="Shot")
15551555
self.assertEqual( 1, len(result) )
1556-
result = self.sg.following(self.human_user,
1557-
project={"type":"Project", "id":task_project_id},
1556+
result = self.sg.following(self.human_user,
1557+
project={"type":"Project", "id":task_project_id},
15581558
entity_type="Task")
15591559
self.assertEqual( 1, len(result) )
15601560

@@ -1701,7 +1701,7 @@ def test_upload_empty_file(self):
17011701
path = os.path.abspath(os.path.expanduser(os.path.join(this_dir,"empty.txt")))
17021702
self.assertRaises(shotgun_api3.ShotgunError, self.sg.upload, 'Version', 123, path)
17031703
self.assertRaises(shotgun_api3.ShotgunError, self.sg.upload_thumbnail, 'Version', 123, path)
1704-
self.assertRaises(shotgun_api3.ShotgunError, self.sg.upload_filmstrip_thumbnail, 'Version',
1704+
self.assertRaises(shotgun_api3.ShotgunError, self.sg.upload_filmstrip_thumbnail, 'Version',
17051705
123, path)
17061706

17071707
def test_upload_missing_file(self):
@@ -1711,7 +1711,7 @@ def test_upload_missing_file(self):
17111711
path = "/path/to/nowhere/foo.txt"
17121712
self.assertRaises(shotgun_api3.ShotgunError, self.sg.upload, 'Version', 123, path)
17131713
self.assertRaises(shotgun_api3.ShotgunError, self.sg.upload_thumbnail, 'Version', 123, path)
1714-
self.assertRaises(shotgun_api3.ShotgunError, self.sg.upload_filmstrip_thumbnail, 'Version',
1714+
self.assertRaises(shotgun_api3.ShotgunError, self.sg.upload_filmstrip_thumbnail, 'Version',
17151715
123, path)
17161716

17171717
# def test_malformed_response(self):
@@ -2525,7 +2525,7 @@ def _has_unicode(data):
25252525

25262526
def _get_path(url):
25272527
"""Returns path component of a url without the sheme, host, query, anchor, or any other
2528-
additional elements.
2528+
additional elements.
25292529
For example, the url "https://foo.shotgunstudio.com/page/2128#Shot_1190_sr10101_034"
25302530
returns "/page/2128"
25312531
"""

tests/test_api_long.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def test_automated_find(self):
3030
continue
3131

3232
# trying to use some different code paths to the other find test
33-
# pivot_column fields aren't valid for sorting so ensure we're
33+
# pivot_column fields aren't valid for sorting so ensure we're
3434
# not using one.
3535
order_field = None
3636
for field_name, field in fields.items():
3737
if field['data_type']["value"] != 'pivot_column':
3838
order_field = field_name
39-
break
39+
break
4040
# TODO for our test project, we haven't populated these entities....
4141
order = [{'field_name': order_field, 'direction': direction}]
4242
if "project" in fields:
@@ -83,7 +83,7 @@ def test_schema(self):
8383

8484
# An explanation is in order here. the field code that is created in shotgun is based on the human display name
8585
# that is provided , so for example "Money Count" would generate the field code 'sg_monkey_count' . The field
86-
# that is created in this test is retired at the end of the test but when this test is run again against
86+
# that is created in this test is retired at the end of the test but when this test is run again against
8787
# the same database ( which happens on our Continuous Integration server ) trying to create a new field
8888
# called "Monkey Count" will now fail due to the new Delete Field Forever features we have added to shotgun
8989
# since there will a retired field called sg_monkey_count. The old behavior was to go ahead and create a new
@@ -94,7 +94,7 @@ def test_schema(self):
9494
human_field_name = "Monkey " + str(random.getrandbits(24))
9595

9696
properties = { "description" : "How many monkeys were needed" }
97-
new_field_name = self.sg.schema_field_create("Version", "number", human_field_name,
97+
new_field_name = self.sg.schema_field_create("Version", "number", human_field_name,
9898
properties=properties)
9999

100100
properties = {"description": "How many monkeys turned up"}

tests/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_user_agent(self):
180180
(_, _, _, headers) = args
181181
ssl_validate_lut = {True: "no-validate", False: "validate"}
182182
expected = "shotgun-json (%s); Python %s (%s); ssl %s (%s)" % (
183-
api.__version__,
183+
api.__version__,
184184
client_caps.py_version,
185185
client_caps.platform.capitalize(),
186186
client_caps.ssl_version,
@@ -194,7 +194,7 @@ def test_user_agent(self):
194194
args, _ = self.sg._http_request.call_args
195195
(_, _, _, headers) = args
196196
expected = "shotgun-json (%s); Python %s (%s); ssl %s (%s); test-agent" % (
197-
api.__version__,
197+
api.__version__,
198198
client_caps.py_version,
199199
client_caps.platform.capitalize(),
200200
client_caps.ssl_version,
@@ -208,7 +208,7 @@ def test_user_agent(self):
208208
args, _ = self.sg._http_request.call_args
209209
(_, _, _, headers) = args
210210
expected = "shotgun-json (%s); Python %s (%s); ssl %s (%s)" % (
211-
api.__version__,
211+
api.__version__,
212212
client_caps.py_version,
213213
client_caps.platform.capitalize(),
214214
client_caps.ssl_version,

tests/tests_proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_proxy_info(self):
1919
self.sg.connect()
2020
if self.config.http_proxy:
2121
sys.stderr.write("[WITH PROXY] ")
22-
self.assertTrue(isinstance(self.sg._connection.proxy_info,
22+
self.assertTrue(isinstance(self.sg._connection.proxy_info,
2323
api.lib.httplib2.ProxyInfo))
2424
else:
2525
sys.stderr.write("[NO PROXY] ")

tests/tests_unit.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ def setUp(self):
1515
def test_http_proxy_server(self):
1616
proxy_server = "someserver.com"
1717
http_proxy = proxy_server
18-
sg = api.Shotgun(self.server_path,
19-
self.script_name,
20-
self.api_key,
18+
sg = api.Shotgun(self.server_path,
19+
self.script_name,
20+
self.api_key,
2121
http_proxy=http_proxy,
2222
connect=False)
2323
self.assertEqual(sg.config.proxy_server, proxy_server)
2424
self.assertEqual(sg.config.proxy_port, 8080)
2525
proxy_server = "123.456.789.012"
2626
http_proxy = proxy_server
27-
sg = api.Shotgun(self.server_path,
28-
self.script_name,
29-
self.api_key,
27+
sg = api.Shotgun(self.server_path,
28+
self.script_name,
29+
self.api_key,
3030
http_proxy=http_proxy,
3131
connect=False)
3232
self.assertEqual(sg.config.proxy_server, proxy_server)
@@ -36,19 +36,19 @@ def test_http_proxy_server_and_port(self):
3636
proxy_server = "someserver.com"
3737
proxy_port = 1234
3838
http_proxy = "%s:%d" % (proxy_server, proxy_port)
39-
sg = api.Shotgun(self.server_path,
40-
self.script_name,
41-
self.api_key,
39+
sg = api.Shotgun(self.server_path,
40+
self.script_name,
41+
self.api_key,
4242
http_proxy=http_proxy,
4343
connect=False)
4444
self.assertEqual(sg.config.proxy_server, proxy_server)
4545
self.assertEqual(sg.config.proxy_port, proxy_port)
4646
proxy_server = "123.456.789.012"
4747
proxy_port = 1234
4848
http_proxy = "%s:%d" % (proxy_server, proxy_port)
49-
sg = api.Shotgun(self.server_path,
50-
self.script_name,
51-
self.api_key,
49+
sg = api.Shotgun(self.server_path,
50+
self.script_name,
51+
self.api_key,
5252
http_proxy=http_proxy,
5353
connect=False)
5454
self.assertEqual(sg.config.proxy_server, proxy_server)
@@ -59,11 +59,11 @@ def test_http_proxy_server_and_port_with_authentication(self):
5959
proxy_port = 1234
6060
proxy_user = "user"
6161
proxy_pass = "password"
62-
http_proxy = "%s:%s@%s:%d" % (proxy_user, proxy_pass, proxy_server,
62+
http_proxy = "%s:%s@%s:%d" % (proxy_user, proxy_pass, proxy_server,
6363
proxy_port)
64-
sg = api.Shotgun(self.server_path,
65-
self.script_name,
66-
self.api_key,
64+
sg = api.Shotgun(self.server_path,
65+
self.script_name,
66+
self.api_key,
6767
http_proxy=http_proxy,
6868
connect=False)
6969
self.assertEqual(sg.config.proxy_server, proxy_server)
@@ -74,11 +74,11 @@ def test_http_proxy_server_and_port_with_authentication(self):
7474
proxy_port = 1234
7575
proxy_user = "user"
7676
proxy_pass = "password"
77-
http_proxy = "%s:%s@%s:%d" % (proxy_user, proxy_pass, proxy_server,
77+
http_proxy = "%s:%s@%s:%d" % (proxy_user, proxy_pass, proxy_server,
7878
proxy_port)
79-
sg = api.Shotgun(self.server_path,
80-
self.script_name,
81-
self.api_key,
79+
sg = api.Shotgun(self.server_path,
80+
self.script_name,
81+
self.api_key,
8282
http_proxy=http_proxy,
8383
connect=False)
8484
self.assertEqual(sg.config.proxy_server, proxy_server)
@@ -91,11 +91,11 @@ def test_http_proxy_with_at_in_password(self):
9191
proxy_port = 1234
9292
proxy_user = "user"
9393
proxy_pass = "p@ssword"
94-
http_proxy = "%s:%s@%s:%d" % (proxy_user, proxy_pass, proxy_server,
94+
http_proxy = "%s:%s@%s:%d" % (proxy_user, proxy_pass, proxy_server,
9595
proxy_port)
96-
sg = api.Shotgun(self.server_path,
97-
self.script_name,
98-
self.api_key,
96+
sg = api.Shotgun(self.server_path,
97+
self.script_name,
98+
self.api_key,
9999
http_proxy=http_proxy,
100100
connect=False)
101101
self.assertEqual(sg.config.proxy_server, proxy_server)
@@ -108,12 +108,12 @@ def test_malformatted_proxy_info(self):
108108
proxy_port = 1234
109109
proxy_user = "user"
110110
proxy_pass = "password"
111-
http_proxy = "%s:%s@%s:%d" % (proxy_user, proxy_pass, proxy_server,
111+
http_proxy = "%s:%s@%s:%d" % (proxy_user, proxy_pass, proxy_server,
112112
proxy_port)
113113
conn_info = {
114114
'base_url': self.server_path,
115115
'script_name': self.script_name,
116-
'api_key': self.api_key,
116+
'api_key': self.api_key,
117117
'connect': False,
118118
}
119119
conn_info['http_proxy'] = 'http://someserver.com'
@@ -130,8 +130,8 @@ class TestShotgunSummarize(unittest.TestCase):
130130
Does not require database connection or test data.'''
131131
def setUp(self):
132132
self.sg = api.Shotgun('http://server_path',
133-
'script_name',
134-
'api_key',
133+
'script_name',
134+
'api_key',
135135
connect=False)
136136

137137

@@ -177,7 +177,7 @@ def test_grouping(self):
177177
result = self.get_call_rpc_params(None, {})
178178
self.assertFalse('grouping' in result)
179179
grouping = ['something']
180-
kws = {'grouping':grouping}
180+
kws = {'grouping':grouping}
181181
result = self.get_call_rpc_params(None, kws)
182182
self.assertEqual(grouping, result['grouping'])
183183

@@ -188,8 +188,8 @@ def test_grouping_type(self):
188188
class TestShotgunBatch(unittest.TestCase):
189189
def setUp(self):
190190
self.sg = api.Shotgun('http://server_path',
191-
'script_name',
192-
'api_key',
191+
'script_name',
192+
'api_key',
193193
connect=False)
194194

195195
def test_missing_required_key(self):

0 commit comments

Comments
 (0)