Fixing up more pep8 issues

This commit is contained in:
Matthew Jones
2015-02-04 16:32:04 -05:00
parent fb9e231189
commit 9e97783b13
16 changed files with 178 additions and 186 deletions

View File

@@ -166,12 +166,11 @@ class BaseTestMixin(QueueTestMixin):
def create_test_license_file(self, instance_count=10000):
writer = LicenseWriter(
company_name='AWX',
contact_name='AWX Admin',
contact_email='awx@example.com',
license_date=int(time.time() + 3600),
instance_count=instance_count,
)
company_name='AWX',
contact_name='AWX Admin',
contact_email='awx@example.com',
license_date=int(time.time() + 3600),
instance_count=instance_count)
handle, license_path = tempfile.mkstemp(suffix='.json')
os.close(handle)
writer.write_file(license_path)
@@ -416,7 +415,7 @@ class BaseTestMixin(QueueTestMixin):
self.assertFalse(response.content)
#if return_response_object:
# return response
if response.status_code not in [ 204, 405 ] and method_name != 'head' and response.content:
if response.status_code not in [204, 405] and method_name != 'head' and response.content:
# no JSON responses in these at least for now, 409 should probably return some (FIXME)
if response['Content-Type'].startswith('application/json'):
obj = json.loads(response.content)
@@ -540,7 +539,7 @@ class BaseTestMixin(QueueTestMixin):
total = qs.count()
if limit is not None:
if limit > 0:
qs = qs[offset:offset+limit]
qs = qs[offset:offset + limit]
else:
qs = qs.none()
self.check_pagination_and_size(response, total, offset > 0,
@@ -633,6 +632,7 @@ class URI(object):
def __string__(self):
return self.get_uri()
def __repr__(self):
return self.get_uri()