summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-09-28 21:48:30 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-09-28 21:48:30 +0000
commit524d254a59fab592a2bf48a84c762dcf8a04b4d5 (patch)
treeabf3d17d269e779f723c3c05cf889fec4a2a8e7b /nova/tests
parent64702669c879dbc5cf27712ef8fadb9fd043664d (diff)
downloadnova-524d254a59fab592a2bf48a84c762dcf8a04b4d5.tar.gz
nova-524d254a59fab592a2bf48a84c762dcf8a04b4d5.tar.xz
nova-524d254a59fab592a2bf48a84c762dcf8a04b4d5.zip
Remove unnecessary setUp, tearDown and __init__ in tests
These methods simply call the same parent class method with the same arguments. This is the default behavior of Python and re-implementing that is unnecessary. Change-Id: I29503f6c5442e2aae645899dc157466e6201ba75
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/cert/test_rpcapi.py7
-rw-r--r--nova/tests/compute/test_rpcapi.py3
-rw-r--r--nova/tests/console/test_rpcapi.py7
-rw-r--r--nova/tests/consoleauth/test_rpcapi.py7
-rw-r--r--nova/tests/integrated/test_api_samples.py3
-rw-r--r--nova/tests/network/test_quantumv2.py3
-rw-r--r--nova/tests/scheduler/test_rpcapi.py7
-rw-r--r--nova/tests/test_flags.py4
-rw-r--r--nova/tests/test_libvirt.py3
-rw-r--r--nova/tests/test_nexenta.py3
-rw-r--r--nova/tests/test_solidfire.py3
-rw-r--r--nova/tests/test_storwize_svc.py3
-rw-r--r--nova/tests/test_virt_drivers.py3
-rw-r--r--nova/tests/volume/test_HpSanISCSIDriver.py3
-rw-r--r--nova/tests/xenapi/stubs.py12
-rw-r--r--nova/tests/xenapi/test_vm_utils.py3
16 files changed, 0 insertions, 74 deletions
diff --git a/nova/tests/cert/test_rpcapi.py b/nova/tests/cert/test_rpcapi.py
index a7c951f6c..58b07ff75 100644
--- a/nova/tests/cert/test_rpcapi.py
+++ b/nova/tests/cert/test_rpcapi.py
@@ -29,13 +29,6 @@ FLAGS = flags.FLAGS
class CertRpcAPITestCase(test.TestCase):
-
- def setUp(self):
- super(CertRpcAPITestCase, self).setUp()
-
- def tearDown(self):
- super(CertRpcAPITestCase, self).tearDown()
-
def _test_cert_api(self, method, **kwargs):
ctxt = context.RequestContext('fake_user', 'fake_project')
rpcapi = cert_rpcapi.CertAPI()
diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py
index 559a56a0a..b0fc9c7c8 100644
--- a/nova/tests/compute/test_rpcapi.py
+++ b/nova/tests/compute/test_rpcapi.py
@@ -39,9 +39,6 @@ class ComputeRpcAPITestCase(test.TestCase):
self.fake_instance = jsonutils.to_primitive(inst)
super(ComputeRpcAPITestCase, self).setUp()
- def tearDown(self):
- super(ComputeRpcAPITestCase, self).tearDown()
-
def test_serialized_instance_has_name(self):
self.assertTrue('name' in self.fake_instance)
diff --git a/nova/tests/console/test_rpcapi.py b/nova/tests/console/test_rpcapi.py
index f1150a079..9499002c6 100644
--- a/nova/tests/console/test_rpcapi.py
+++ b/nova/tests/console/test_rpcapi.py
@@ -29,13 +29,6 @@ FLAGS = flags.FLAGS
class ConsoleRpcAPITestCase(test.TestCase):
-
- def setUp(self):
- super(ConsoleRpcAPITestCase, self).setUp()
-
- def tearDown(self):
- super(ConsoleRpcAPITestCase, self).tearDown()
-
def _test_console_api(self, method, **kwargs):
ctxt = context.RequestContext('fake_user', 'fake_project')
rpcapi = console_rpcapi.ConsoleAPI()
diff --git a/nova/tests/consoleauth/test_rpcapi.py b/nova/tests/consoleauth/test_rpcapi.py
index 10484c7d9..c59e322b8 100644
--- a/nova/tests/consoleauth/test_rpcapi.py
+++ b/nova/tests/consoleauth/test_rpcapi.py
@@ -29,13 +29,6 @@ FLAGS = flags.FLAGS
class ConsoleAuthRpcAPITestCase(test.TestCase):
-
- def setUp(self):
- super(ConsoleAuthRpcAPITestCase, self).setUp()
-
- def tearDown(self):
- super(ConsoleAuthRpcAPITestCase, self).tearDown()
-
def _test_consoleauth_api(self, method, **kwargs):
ctxt = context.RequestContext('fake_user', 'fake_project')
rpcapi = consoleauth_rpcapi.ConsoleAuthAPI()
diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py
index df239db2a..6aa1111e2 100644
--- a/nova/tests/integrated/test_api_samples.py
+++ b/nova/tests/integrated/test_api_samples.py
@@ -506,9 +506,6 @@ class LimitsSampleXmlTest(LimitsSampleJsonTest):
class ServersActionsJsonTest(ServersSampleBase):
- def setUp(self):
- super(ServersActionsJsonTest, self).setUp()
-
def _test_server_action(self, uuid, action,
subs={}, resp_tpl=None, code=202):
subs.update({'action': action})
diff --git a/nova/tests/network/test_quantumv2.py b/nova/tests/network/test_quantumv2.py
index 83703707e..888027b21 100644
--- a/nova/tests/network/test_quantumv2.py
+++ b/nova/tests/network/test_quantumv2.py
@@ -84,9 +84,6 @@ class MyComparator(mox.Comparator):
class TestQuantumClient(test.TestCase):
- def setUp(self):
- super(TestQuantumClient, self).setUp()
-
def test_withtoken(self):
self.flags(quantum_url='http://anyhost/')
self.flags(quantum_url_timeout=30)
diff --git a/nova/tests/scheduler/test_rpcapi.py b/nova/tests/scheduler/test_rpcapi.py
index ab97adf5c..100812175 100644
--- a/nova/tests/scheduler/test_rpcapi.py
+++ b/nova/tests/scheduler/test_rpcapi.py
@@ -29,13 +29,6 @@ FLAGS = flags.FLAGS
class SchedulerRpcAPITestCase(test.TestCase):
-
- def setUp(self):
- super(SchedulerRpcAPITestCase, self).setUp()
-
- def tearDown(self):
- super(SchedulerRpcAPITestCase, self).tearDown()
-
def _test_scheduler_api(self, method, rpc_method, **kwargs):
ctxt = context.RequestContext('fake_user', 'fake_project')
rpcapi = scheduler_rpcapi.SchedulerAPI()
diff --git a/nova/tests/test_flags.py b/nova/tests/test_flags.py
index 9669579fd..973d54a1f 100644
--- a/nova/tests/test_flags.py
+++ b/nova/tests/test_flags.py
@@ -28,10 +28,6 @@ FLAGS.register_opt(cfg.StrOpt('flags_unittest',
class FlagsTestCase(test.TestCase):
-
- def setUp(self):
- super(FlagsTestCase, self).setUp()
-
def test_declare(self):
self.assert_('answer' not in FLAGS)
flags.DECLARE('answer', 'nova.tests.declare_flags')
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index 10db13e17..3d33fad8f 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -3912,9 +3912,6 @@ class LibvirtNonblockingTestCase(test.TestCase):
super(LibvirtNonblockingTestCase, self).setUp()
self.flags(libvirt_nonblocking=True, libvirt_uri="test:///default")
- def tearDown(self):
- super(LibvirtNonblockingTestCase, self).tearDown()
-
def test_connection_to_primitive(self):
"""Test bug 962840"""
import nova.virt.libvirt.driver as libvirt_driver
diff --git a/nova/tests/test_nexenta.py b/nova/tests/test_nexenta.py
index 8b8f8e138..aac877cc1 100644
--- a/nova/tests/test_nexenta.py
+++ b/nova/tests/test_nexenta.py
@@ -48,9 +48,6 @@ class TestNexentaDriver(nova.test.TestCase):
'volume_name': TEST_VOLUME_NAME,
}
- def __init__(self, method):
- super(TestNexentaDriver, self).__init__(method)
-
def setUp(self):
super(TestNexentaDriver, self).setUp()
self.flags(
diff --git a/nova/tests/test_solidfire.py b/nova/tests/test_solidfire.py
index 475281d2b..87a211da5 100644
--- a/nova/tests/test_solidfire.py
+++ b/nova/tests/test_solidfire.py
@@ -24,9 +24,6 @@ LOG = logging.getLogger(__name__)
class SolidFireVolumeTestCase(test.TestCase):
- def setUp(self):
- super(SolidFireVolumeTestCase, self).setUp()
-
def fake_issue_api_request(obj, method, params):
if method is 'GetClusterInfo':
LOG.info('Called Fake GetClusterInfo...')
diff --git a/nova/tests/test_storwize_svc.py b/nova/tests/test_storwize_svc.py
index c74cc6b9f..513043256 100644
--- a/nova/tests/test_storwize_svc.py
+++ b/nova/tests/test_storwize_svc.py
@@ -889,9 +889,6 @@ class StorwizeSVCManagementSimulator:
class StorwizeSVCFakeDriver(storwize_svc.StorwizeSVCDriver):
- def __init__(self, *args, **kwargs):
- super(StorwizeSVCFakeDriver, self).__init__(*args, **kwargs)
-
def set_fake_storage(self, fake):
self.fake_storage = fake
diff --git a/nova/tests/test_virt_drivers.py b/nova/tests/test_virt_drivers.py
index 18b6bdc7d..d24ad615a 100644
--- a/nova/tests/test_virt_drivers.py
+++ b/nova/tests/test_virt_drivers.py
@@ -554,9 +554,6 @@ class LibvirtConnTestCase(_VirtDriverTestCase):
self.driver_module = 'nova.virt.libvirt.LibvirtDriver'
super(LibvirtConnTestCase, self).setUp()
- def tearDown(self):
- super(LibvirtConnTestCase, self).tearDown()
-
def test_force_hard_reboot(self):
self.flags(libvirt_wait_soft_reboot_seconds=0)
self.test_reboot()
diff --git a/nova/tests/volume/test_HpSanISCSIDriver.py b/nova/tests/volume/test_HpSanISCSIDriver.py
index 6c9ca8a87..d6d3f3488 100644
--- a/nova/tests/volume/test_HpSanISCSIDriver.py
+++ b/nova/tests/volume/test_HpSanISCSIDriver.py
@@ -38,9 +38,6 @@ class HpSanISCSITestCase(test.TestCase):
'iqn.2003-10.com.lefthandnetworks:group01:25366:fakev',
'volume_id': 1}
- def tearDown(self):
- super(HpSanISCSITestCase, self).tearDown()
-
def _fake_get_iscsi_properties(self, volume):
return self.properties
diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py
index 3bfdd3dbe..fa1108175 100644
--- a/nova/tests/xenapi/stubs.py
+++ b/nova/tests/xenapi/stubs.py
@@ -164,9 +164,6 @@ class FakeSessionForVMTests(fake.SessionBase):
"COMMIT\n"
"# Completed on Sun Nov 6 22:49:02 2011\n")
- def __init__(self, uri):
- super(FakeSessionForVMTests, self).__init__(uri)
-
def host_call_plugin(self, _1, _2, plugin, method, _5):
if (plugin, method) == ('glance', 'download_vhd'):
root_uuid = _make_fake_vdi()
@@ -286,9 +283,6 @@ def stub_out_vm_methods(stubs):
class FakeSessionForVolumeTests(fake.SessionBase):
""" Stubs out a XenAPISession for Volume tests """
- def __init__(self, uri):
- super(FakeSessionForVolumeTests, self).__init__(uri)
-
def VDI_introduce(self, _1, uuid, _2, _3, _4, _5,
_6, _7, _8, _9, _10, _11):
valid_vdi = False
@@ -303,9 +297,6 @@ class FakeSessionForVolumeTests(fake.SessionBase):
class FakeSessionForVolumeFailedTests(FakeSessionForVolumeTests):
""" Stubs out a XenAPISession for Volume tests: it injects failures """
- def __init__(self, uri):
- super(FakeSessionForVolumeFailedTests, self).__init__(uri)
-
def VDI_introduce(self, _1, uuid, _2, _3, _4, _5,
_6, _7, _8, _9, _10, _11):
# This is for testing failure
@@ -358,9 +349,6 @@ def stub_out_migration_methods(stubs):
class FakeSessionForFailedMigrateTests(FakeSessionForVMTests):
- def __init__(self, uri):
- super(FakeSessionForFailedMigrateTests, self).__init__(uri)
-
def VM_assert_can_migrate(self, session, vmref, migrate_data,
live, vdi_map, vif_map, options):
raise fake.Failure("XenAPI VM.assert_can_migrate failed")
diff --git a/nova/tests/xenapi/test_vm_utils.py b/nova/tests/xenapi/test_vm_utils.py
index 869a920a4..158205817 100644
--- a/nova/tests/xenapi/test_vm_utils.py
+++ b/nova/tests/xenapi/test_vm_utils.py
@@ -14,9 +14,6 @@ class GetInstanceForVdisForSrTestCase(stubs.XenAPITestBase):
xenapi_connection_url='test_url',
xenapi_connection_password='test_pass',)
- def tearDown(self):
- super(GetInstanceForVdisForSrTestCase, self).tearDown()
-
def test_get_instance_vdis_for_sr(self):
vm_ref = fake.create_vm("foo", "Running")
sr_ref = fake.create_sr()