Skip to content

Commit

Permalink
Fix E128 failures in novaclient/tests
Browse files Browse the repository at this point in the history
E128 continuation line under-indented for visual indent

Change-Id: Ie751df84ad289e025bd8ccd4e294228bed803aa5
  • Loading branch information
EuKudryashova committed Nov 18, 2014
1 parent 545d604 commit 2126b93
Show file tree
Hide file tree
Showing 22 changed files with 249 additions and 210 deletions.
2 changes: 1 addition & 1 deletion novaclient/tests/fakes.py
Expand Up @@ -30,7 +30,7 @@ def assert_has_keys(dict, required=[], optional=[]):
except AssertionError:
extra_keys = set(keys).difference(set(required + optional))
raise AssertionError("found unexpected keys: %s" %
list(extra_keys))
list(extra_keys))


class FakeClient(object):
Expand Down
4 changes: 2 additions & 2 deletions novaclient/tests/fixture_data/client.py
Expand Up @@ -47,8 +47,8 @@ def setUp(self):
auth_url = '%s/tokens' % self.identity_url
headers = {'X-Content-Type': 'application/json'}
self.requests.register_uri('POST', auth_url,
json=self.token,
headers=headers)
json=self.token,
headers=headers)
self.client = self.new_client()

def new_client(self):
Expand Down
10 changes: 5 additions & 5 deletions novaclient/tests/fixture_data/cloudpipe.py
Expand Up @@ -22,15 +22,15 @@ def setUp(self):

get_os_cloudpipe = {'cloudpipes': [{'project_id': 1}]}
self.requests.register_uri('GET', self.url(),
json=get_os_cloudpipe,
headers=self.json_headers)
json=get_os_cloudpipe,
headers=self.json_headers)

instance_id = '9d5824aa-20e6-4b9f-b967-76a699fc51fd'
post_os_cloudpipe = {'instance_id': instance_id}
self.requests.register_uri('POST', self.url(),
json=post_os_cloudpipe,
headers=self.json_headers,
status_code=202)
json=post_os_cloudpipe,
headers=self.json_headers,
status_code=202)

self.requests.register_uri('PUT', self.url('configure-project'),
headers=self.json_headers,
Expand Down
4 changes: 2 additions & 2 deletions novaclient/tests/fixture_data/floatingips.py
Expand Up @@ -47,8 +47,8 @@ def post_os_floating_ips(request, context):
ip['pool'] = body.get('pool')
return {'floating_ip': ip}
self.requests.register_uri('POST', self.url(),
json=post_os_floating_ips,
headers=self.json_headers)
json=post_os_floating_ips,
headers=self.json_headers)


class DNSFixture(base.Fixture):
Expand Down
4 changes: 2 additions & 2 deletions novaclient/tests/fixture_data/networks.py
Expand Up @@ -44,8 +44,8 @@ def post_os_networks(request, context):
return {'network': body}

self.requests.register_uri("POST", self.url(),
json=post_os_networks,
headers=headers)
json=post_os_networks,
headers=headers)

get_os_networks_1 = {'network': {"label": "1", "cidr": "10.0.0.0/24"}}

Expand Down
12 changes: 7 additions & 5 deletions novaclient/tests/fixture_data/servers.py
Expand Up @@ -346,7 +346,8 @@ def setUp(self):
# tI2/++UsXVg3ow6ItqCJGgdNuGG5JB+bslDHWPxROpesEIHdczk46HCpHQN8f1sk
# Hi/fmZZNQQqj1Ijq0caOIw==

get_server_password = {'password':
get_server_password = {
'password':
'OIuEuQttO8Rk93BcKlwHQsziDAnkAm/V6V8VPToA8ZeUaUBWwS0gwo2K6Y61Z96r'
'qG447iRz0uTEEYq3RAYJk1mh3mMIRVl27t8MtIecR5ggVVbz1S9AwXJQypDKl0ho'
'QFvhCBcMWPohyGewDJOhDbtuN1IoFI9G55ZvFwCm5y7m7B2aVcoLeIsJZE4PLsIw'
Expand Down Expand Up @@ -543,10 +544,11 @@ def setUp(self):
def post_servers(self, request, context):
body = jsonutils.loads(request.body)
assert set(body.keys()) <= set(['server'])
fakes.assert_has_keys(body['server'],
required=['name', 'image_ref', 'flavor_ref'],
optional=['metadata', 'personality',
'os-scheduler-hints:scheduler_hints'])
fakes.assert_has_keys(
body['server'],
required=['name', 'image_ref', 'flavor_ref'],
optional=['metadata', 'personality',
'os-scheduler-hints:scheduler_hints'])
if body['server']['name'] == 'some-bad-server':
body = self.server_1235
else:
Expand Down
14 changes: 7 additions & 7 deletions novaclient/tests/test_auth_plugins.py
Expand Up @@ -133,8 +133,8 @@ def authenticate(self, cls, auth_url):
def mock_iter_entry_points(_type, name):
if _type == 'openstack.client.auth_url':
return [MockAuthUrlEntrypoint("fakewithauthurl",
"fakewithauthurl",
["auth_url"])]
"fakewithauthurl",
["auth_url"])]
elif _type == 'openstack.client.authenticate':
return [MockAuthenticateEntrypoint("fakewithauthurl",
"fakewithauthurl",
Expand Down Expand Up @@ -221,9 +221,9 @@ class FakePlugin(auth_plugin.BaseAuthPlugin):
@staticmethod
def add_opts(parser):
parser.add_argument('--auth_system_opt',
default=False,
action='store_true',
help="Fake option")
default=False,
action='store_true',
help="Fake option")
return parser

class MockEntrypoint(pkg_resources.EntryPoint):
Expand Down Expand Up @@ -281,8 +281,8 @@ def get_auth_url(self):
plugin = auth_plugin.load_plugin("fake")

cs = client.Client("username", "password", "project_id",
auth_system="fakewithauthurl",
auth_plugin=plugin)
auth_system="fakewithauthurl",
auth_plugin=plugin)
self.assertEqual("http://faked/v2.0", cs.client.auth_url)

@mock.patch.object(pkg_resources, "iter_entry_points")
Expand Down
5 changes: 3 additions & 2 deletions novaclient/tests/test_client.py
Expand Up @@ -371,8 +371,9 @@ def test_log_req(self):
'X-Auth-Token': 'totally_bogus'}
})
cs.http_log_req('GET', '/foo', {'headers': {},
'data': '{"auth": {"passwordCredentials": '
'{"password": "zhaoqin"}}}'})
'data':
'{"auth": {"passwordCredentials": '
'{"password": "zhaoqin"}}}'})

output = self.logger.output.split('\n')

Expand Down
21 changes: 12 additions & 9 deletions novaclient/tests/v1_1/contrib/fakes.py
Expand Up @@ -26,19 +26,22 @@ def __init__(self, *args, **kwargs):

class FakeHTTPClient(fakes.FakeHTTPClient):
def get_os_tenant_networks(self):
return (200, {}, {'networks': [{"label": "1", "cidr": "10.0.0.0/24",
'project_id': '4ffc664c198e435e9853f2538fbcd7a7',
'id': '1'}]})
return (200, {}, {
'networks': [{"label": "1", "cidr": "10.0.0.0/24",
'project_id': '4ffc664c198e435e9853f2538fbcd7a7',
'id': '1'}]})

def get_os_tenant_networks_1(self, **kw):
return (200, {}, {'network': {"label": "1", "cidr": "10.0.0.0/24",
'project_id': '4ffc664c198e435e9853f2538fbcd7a7',
'id': '1'}})
return (200, {}, {
'network': {"label": "1", "cidr": "10.0.0.0/24",
'project_id': '4ffc664c198e435e9853f2538fbcd7a7',
'id': '1'}})

def post_os_tenant_networks(self, **kw):
return (201, {}, {'network': {"label": "1", "cidr": "10.0.0.0/24",
'project_id': '4ffc664c198e435e9853f2538fbcd7a7',
'id': '1'}})
return (201, {}, {
'network': {"label": "1", "cidr": "10.0.0.0/24",
'project_id': '4ffc664c198e435e9853f2538fbcd7a7',
'id': '1'}})

def delete_os_tenant_networks_1(self, **kw):
return (204, {}, None)
Expand Down
Expand Up @@ -37,5 +37,6 @@ def test_create_snap(self):

def test_delete_snap(self):
cs.assisted_volume_snapshots.delete('x', {})
cs.assert_called('DELETE',
'/os-assisted-volume-snapshots/x?delete_info={}')
cs.assert_called(
'DELETE',
'/os-assisted-volume-snapshots/x?delete_info={}')
10 changes: 6 additions & 4 deletions novaclient/tests/v1_1/contrib/test_instance_actions.py
Expand Up @@ -30,12 +30,14 @@ class InstanceActionExtensionTests(utils.TestCase):
def test_list_instance_actions(self):
server_uuid = '1234'
cs.instance_action.list(server_uuid)
cs.assert_called('GET', '/servers/%s/os-instance-actions' %
server_uuid)
cs.assert_called(
'GET', '/servers/%s/os-instance-actions' %
server_uuid)

def test_get_instance_action(self):
server_uuid = '1234'
request_id = 'req-abcde12345'
cs.instance_action.get(server_uuid, request_id)
cs.assert_called('GET', '/servers/%s/os-instance-actions/%s' %
(server_uuid, request_id))
cs.assert_called(
'GET', '/servers/%s/os-instance-actions/%s'
% (server_uuid, request_id))

0 comments on commit 2126b93

Please sign in to comment.