From 21dcf669c72fddc7b26018388e678fe0b033e318 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 22 Sep 2011 18:22:42 -0400 Subject: Fix outstanding pep8 errors for a clean trunk. Also, add an option to run_tests.sh to skip running pep8. We have a separate job in Jenkins which runs pep8, so there's no need to spin our wheels on it during the test run. Change-Id: I552330994e55a36fa96b63658493ed30e2720c85 --- nova/tests/api/openstack/test_flavors.py | 6 ++++-- nova/tests/api/openstack/test_servers.py | 2 +- nova/tests/fake_network.py | 2 +- nova/tests/scheduler/test_scheduler.py | 2 +- nova/tests/test_libvirt.py | 16 ++++++++-------- 5 files changed, 15 insertions(+), 13 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/api/openstack/test_flavors.py b/nova/tests/api/openstack/test_flavors.py index 743dddfc4..77aefe507 100644 --- a/nova/tests/api/openstack/test_flavors.py +++ b/nova/tests/api/openstack/test_flavors.py @@ -641,7 +641,8 @@ class FlavorsXMLSerializationTest(test.TestCase): "href": "http://localhost/fake/flavors/23", }, ], - }, { + }, + { "id": "13", "name": "flavor 13", "ram": "256", @@ -706,7 +707,8 @@ class FlavorsXMLSerializationTest(test.TestCase): "href": "http://localhost/fake/flavors/23", }, ], - }, { + }, + { "id": "13", "name": "flavor 13", "ram": "256", diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py index 107e332d1..c8d62d71a 100644 --- a/nova/tests/api/openstack/test_servers.py +++ b/nova/tests/api/openstack/test_servers.py @@ -738,7 +738,7 @@ class ServersTest(test.TestCase): self.assertEquals(ip.getAttribute('addr'), '1.2.3.4') (private,) = server.getElementsByTagName('private') (ip,) = private.getElementsByTagName('ip') - self.assertEquals(ip.getAttribute('addr'), '192.168.0.3') + self.assertEquals(ip.getAttribute('addr'), '192.168.0.3') def test_get_server_by_id_with_addresses(self): private = "192.168.0.3" diff --git a/nova/tests/fake_network.py b/nova/tests/fake_network.py index febac5e09..35d0811ef 100644 --- a/nova/tests/fake_network.py +++ b/nova/tests/fake_network.py @@ -72,7 +72,7 @@ class FakeNetworkManager(network_manager.NetworkManager): class FakeDB: def fixed_ip_get_by_instance(self, context, instance_id): - return [dict(address='10.0.0.0'), dict(address='10.0.0.1'), + return [dict(address='10.0.0.0'), dict(address='10.0.0.1'), dict(address='10.0.0.2')] def network_get_by_cidr(self, context, cidr): diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py index 0b51792a0..3a10e9287 100644 --- a/nova/tests/scheduler/test_scheduler.py +++ b/nova/tests/scheduler/test_scheduler.py @@ -1069,7 +1069,7 @@ class ZoneRedirectTest(test.TestCase): self.assertEquals(decorator.get_collection_context_and_id( (None, 10, 20), {}), ("servers", 10, 20)) self.assertEquals(decorator.get_collection_context_and_id( - (None, 11,), dict(instance_id=21)), ("servers", 11, 21)) + (None, 11,), dict(instance_id=21)), ("servers", 11, 21)) self.assertEquals(decorator.get_collection_context_and_id( (None,), dict(context=12, instance_id=22)), ("servers", 12, 22)) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 39aa4ad41..aefe26cc8 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -159,14 +159,14 @@ class LibvirtConnTestCase(test.TestCase): self.flags(instances_path='') self.call_libvirt_dependant_setup = False - test_instance = {'memory_kb': '1024000', - 'basepath': '/some/path', - 'bridge_name': 'br100', - 'vcpus': 2, - 'project_id': 'fake', - 'bridge': 'br101', - 'image_ref': '123456', - 'local_gb': 20, + test_instance = {'memory_kb': '1024000', + 'basepath': '/some/path', + 'bridge_name': 'br100', + 'vcpus': 2, + 'project_id': 'fake', + 'bridge': 'br101', + 'image_ref': '123456', + 'local_gb': 20, 'instance_type_id': '5'} # m1.small def lazy_load_library_exists(self): -- cgit