fix pep8 issues

This commit is contained in:
William Wolf
2011-06-01 10:31:53 -04:00
parent b8f2f8d636
commit 3fa4ece45e
6 changed files with 24 additions and 27 deletions

View File

@@ -168,8 +168,10 @@ def stub_out_glance(stubs, initial_fixtures=None):
def fake_get_images(self, filters=None, marker=None, limit=None):
found = True
if marker: found = False
if limit == 0: limit = None
if marker:
found = False
if limit == 0:
limit = None
fixtures = []
count = 0
@@ -188,8 +190,10 @@ def stub_out_glance(stubs, initial_fixtures=None):
def fake_get_images_detailed(self, filters=None,
marker=None, limit=None):
found = True
if marker: found = False
if limit == 0: limit = None
if marker:
found = False
if limit == 0:
limit = None
fixtures = []
count = 0
@@ -202,7 +206,6 @@ def stub_out_glance(stubs, initial_fixtures=None):
if f['id'] == marker:
found = True
return fixtures
def fake_get_image_meta(self, image_id):

View File

@@ -301,9 +301,8 @@ class GlanceImageServiceTest(_BaseImageServiceTests):
i = 2
for meta in image_metas:
expected = {'id': 'DONTCARE', 'status': None,
'is_public': True, 'properties':{
'updated': None, 'created': None
},
'is_public': True, 'properties': {
'updated': None, 'created': None},
'name': 'TestImage %d' % (i)}
self.assertDictMatch(meta, expected)
i = i + 1
@@ -332,9 +331,8 @@ class GlanceImageServiceTest(_BaseImageServiceTests):
i = 4
for meta in image_metas:
expected = {'id': 'DONTCARE', 'status': None,
'is_public': True, 'properties':{
'updated': None, 'created': None
},
'is_public': True, 'properties': {
'updated': None, 'created': None},
'name': 'TestImage %d' % (i)}
self.assertDictMatch(meta, expected)
i = i + 1

View File

@@ -774,8 +774,7 @@ class ServersTest(test.TestCase):
def server_update(context, id, params):
filtered_dict = dict(
display_name='server_test'
)
display_name='server_test')
self.assertEqual(params, filtered_dict)
return filtered_dict

View File

@@ -194,8 +194,7 @@ class ServersTest(integrated_helpers._IntegratedTestBase):
post = {}
post['rebuild'] = {
"imageRef": "https://localhost/v1.1/32278/images/2",
"name": "blah"
}
"name": "blah"}
self.api.post_server_action(created_server_id, post)
LOG.debug("rebuilt server: %s" % created_server)
@@ -224,8 +223,7 @@ class ServersTest(integrated_helpers._IntegratedTestBase):
post = {}
post['rebuild'] = {
"imageRef": "https://localhost/v1.1/32278/images/2",
"name": "blah"
}
"name": "blah"}
metadata = {}
for i in range(30):
@@ -267,8 +265,7 @@ class ServersTest(integrated_helpers._IntegratedTestBase):
post = {}
post['rebuild'] = {
"imageRef": "https://localhost/v1.1/32278/images/2",
"name": "blah"
}
"name": "blah"}
metadata = {}
post['rebuild']['metadata'] = metadata