Remove empty setUp/tearDown methods
Python will call into the parent classes implementation of setUp/tearDown if there is no implementation in the child Also, make sure all setUp implementations subclassed off test.TestClass call the parent setUp so everything gets setup correctly Change-Id: If410cd412d9557a0d3172ec96b592fbd3fd67ffd
This commit is contained in:
		| @@ -32,9 +32,6 @@ class RpcCarrotTestCase(common._BaseRpcTestCase): | ||||
|         self.rpc = impl_carrot | ||||
|         super(RpcCarrotTestCase, self).setUp(supports_timeouts=False) | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(RpcCarrotTestCase, self).tearDown() | ||||
|  | ||||
|     def test_connectionpool_single(self): | ||||
|         """Test that ConnectionPool recycles a single connection.""" | ||||
|         conn1 = self.rpc.ConnectionPool.get() | ||||
|   | ||||
| @@ -31,6 +31,3 @@ class RpcFakeTestCase(common._BaseRpcTestCase): | ||||
|     def setUp(self): | ||||
|         self.rpc = impl_fake | ||||
|         super(RpcFakeTestCase, self).setUp() | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(RpcFakeTestCase, self).tearDown() | ||||
|   | ||||
| @@ -32,7 +32,7 @@ SSL_KEYFILE = "/tmp/keyfile.blah.blah" | ||||
| class RpcKombuSslTestCase(test.TestCase): | ||||
|  | ||||
|     def setUp(self): | ||||
|         test.TestCase.setUp(self) | ||||
|         super(RpcKombuSslTestCase, self).setUp() | ||||
|         self.flags(kombu_ssl_keyfile=SSL_KEYFILE, | ||||
|                    kombu_ssl_ca_certs=SSL_CA_CERT, | ||||
|                    kombu_ssl_certfile=SSL_CERT, | ||||
|   | ||||
| @@ -36,9 +36,6 @@ class LeastCostTestCase(test.TestCase): | ||||
|         self.flags(reserved_host_disk_mb=0, reserved_host_memory_mb=0) | ||||
|         self.host_manager = fakes.FakeHostManager() | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(LeastCostTestCase, self).tearDown() | ||||
|  | ||||
|     def _get_all_hosts(self): | ||||
|         ctxt = context.get_admin_context() | ||||
|         fakes.mox_host_manager_db_calls(self.mox, ctxt) | ||||
| @@ -93,13 +90,6 @@ class LeastCostTestCase(test.TestCase): | ||||
|  | ||||
|  | ||||
| class TestWeightedHost(test.TestCase): | ||||
|  | ||||
|     def setUp(self): | ||||
|         pass | ||||
|  | ||||
|     def tearDown(self): | ||||
|         pass | ||||
|  | ||||
|     def test_dict_conversion_without_host_state(self): | ||||
|         host = least_cost.WeightedHost('someweight') | ||||
|         expected = {'weight': 'someweight'} | ||||
|   | ||||
| @@ -27,9 +27,6 @@ class SolidFireVolumeTestCase(test.TestCase): | ||||
|     def setUp(self): | ||||
|         super(SolidFireVolumeTestCase, self).setUp() | ||||
|  | ||||
|     def tearDown(self): | ||||
|         pass | ||||
|  | ||||
|     def fake_issue_api_request(obj, method, params): | ||||
|         if method is 'GetClusterInfo': | ||||
|             LOG.info('Called Fake GetClusterInfo...') | ||||
|   | ||||
| @@ -3297,9 +3297,6 @@ class ComputeAPIAggrTestCase(test.TestCase): | ||||
|         self.stubs.Set(rpc, 'call', fake_rpc_method) | ||||
|         self.stubs.Set(rpc, 'cast', fake_rpc_method) | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(ComputeAPIAggrTestCase, self).tearDown() | ||||
|  | ||||
|     def test_create_invalid_availability_zone(self): | ||||
|         """Ensure InvalidAggregateAction is raised with wrong avail_zone.""" | ||||
|         self.assertRaises(exception.InvalidAggregateAction, | ||||
| @@ -3515,9 +3512,6 @@ class ComputeAggrTestCase(BaseTestCase): | ||||
|                   'availability_zone': 'test_zone', } | ||||
|         self.aggr = db.aggregate_create(self.context, values) | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(ComputeAggrTestCase, self).tearDown() | ||||
|  | ||||
|     def test_add_aggregate_host(self): | ||||
|         def fake_driver_add_to_aggregate(context, aggregate, host): | ||||
|             fake_driver_add_to_aggregate.called = True | ||||
|   | ||||
| @@ -43,9 +43,6 @@ class ConsoleauthTestCase(test.TestCase): | ||||
|         self.manager = utils.import_object(FLAGS.consoleauth_manager) | ||||
|         self.context = context.get_admin_context() | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(ConsoleauthTestCase, self).tearDown() | ||||
|  | ||||
|     def test_tokens_expire(self): | ||||
|         """Test that tokens expire correctly.""" | ||||
|         token = 'mytok' | ||||
|   | ||||
| @@ -320,9 +320,6 @@ class AggregateDBApiTestCase(test.TestCase): | ||||
|         self.project_id = 'fake' | ||||
|         self.context = context.RequestContext(self.user_id, self.project_id) | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(AggregateDBApiTestCase, self).tearDown() | ||||
|  | ||||
|     def test_aggregate_create(self): | ||||
|         """Ensure aggregate can be created with no metadata.""" | ||||
|         result = _create_aggregate(metadata=None) | ||||
|   | ||||
| @@ -34,9 +34,6 @@ class RootwrapTestCase(test.TestCase): | ||||
|             filters.CommandFilter("/bin/cat", "root")  # Keep this one last | ||||
|             ] | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(RootwrapTestCase, self).tearDown() | ||||
|  | ||||
|     def test_RegExpFilter_match(self): | ||||
|         usercmd = ["ls", "/root"] | ||||
|         filtermatch = wrapper.match_filter(self.filters, usercmd) | ||||
|   | ||||
| @@ -33,9 +33,6 @@ class SignerTestCase(test.TestCase): | ||||
|         super(SignerTestCase, self).setUp() | ||||
|         self.signer = signer.Signer('uV3F3YluFJax1cknvbcGwgjvx4QpvB+leU8dUj2o') | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(SignerTestCase, self).tearDown() | ||||
|  | ||||
|     # S3 Authorization Signing input & output examples taken from here: | ||||
|     # http://docs.amazonwebservices.com/AmazonS3/latest/dev/ | ||||
|     def test_s3_authorization_get(self): | ||||
|   | ||||
| @@ -816,9 +816,6 @@ class XenAPIDiffieHellmanTestCase(test.TestCase): | ||||
|     def test_encrypt_really_long_message(self): | ||||
|         self._test_encryption(''.join(['abcd' for i in xrange(1024)])) | ||||
|  | ||||
|     def tearDown(self): | ||||
|         super(XenAPIDiffieHellmanTestCase, self).tearDown() | ||||
|  | ||||
|  | ||||
| class XenAPIMigrateInstance(test.TestCase): | ||||
|     """Unit test for verifying migration-related actions.""" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Johannes Erdfelt
					Johannes Erdfelt