Tests: Remove the redundant methods

This patch removes the redundant tearDown() methods
in order to keep the code clean, In the subclass,
tearDown methods has no benefit from that,
the one in superclass will satisfy that

Change-Id: I0c23ceb133ebd0e1af41195a24597c3ce9e443b0
This commit is contained in:
liuxiaoyang
2017-06-20 15:52:46 +08:00
parent 0325eaf2ac
commit 26abf9afd4
7 changed files with 0 additions and 29 deletions

View File

@@ -57,9 +57,6 @@ class TestPropertyRulesWithRoles(base.IsolatedUnitTest):
self.set_property_protections()
self.policy = policy.Enforcer()
def tearDown(self):
super(TestPropertyRulesWithRoles, self).tearDown()
def test_is_property_protections_enabled_true(self):
self.config(property_protection_file="property-protections.conf")
self.assertTrue(property_utils.is_property_protection_enabled())
@@ -335,9 +332,6 @@ class TestPropertyRulesWithPolicies(base.IsolatedUnitTest):
self.policy = policy.Enforcer()
self.rules_checker = property_utils.PropertyRules(self.policy)
def tearDown(self):
super(TestPropertyRulesWithPolicies, self).tearDown()
def test_check_property_rules_create_permitted_specific_policy(self):
self.assertTrue(self.rules_checker.check_property_rules(
'spl_creator_policy', 'create',

View File

@@ -28,9 +28,6 @@ class TestSwiftParams(base.IsolatedUnitTest):
self.swift_config_file = self._copy_data_file(conf_file, test_dir)
self.config(swift_store_config_file=self.swift_config_file)
def tearDown(self):
super(TestSwiftParams, self).tearDown()
def test_multiple_swift_account_enabled(self):
self.config(swift_store_config_file="glance-swift.conf")
self.assertTrue(

View File

@@ -55,9 +55,6 @@ class TestImageQuota(test_utils.BaseTestCase):
def setUp(self):
super(TestImageQuota, self).setUp()
def tearDown(self):
super(TestImageQuota, self).tearDown()
def _get_image(self, location_count=1, image_size=10):
context = FakeContext()
db_api = unit_test_utils.FakeDB()

View File

@@ -128,9 +128,6 @@ class TestScrubDBQueue(test_utils.BaseTestCase):
def setUp(self):
super(TestScrubDBQueue, self).setUp()
def tearDown(self):
super(TestScrubDBQueue, self).tearDown()
def _create_image_list(self, count):
images = []
for x in range(count):

View File

@@ -876,10 +876,6 @@ class TestRegistryV1ClientApi(base.IsolatedUnitTest):
self.context = context.RequestContext()
reload_module(rapi)
def tearDown(self):
"""Clear the test environment."""
super(TestRegistryV1ClientApi, self).tearDown()
def test_get_registry_client(self):
actual_client = rapi.get_registry_client(self.context)
self.assertIsNone(actual_client.identity_headers)
@@ -954,9 +950,6 @@ class TestRegistryV1ClientRequests(base.IsolatedUnitTest):
def setUp(self):
super(TestRegistryV1ClientRequests, self).setUp()
def tearDown(self):
super(TestRegistryV1ClientRequests, self).tearDown()
def test_do_request_with_identity_headers(self):
identity_headers = {'foo': 'bar'}
self.client = rclient.RegistryClient("0.0.0.0",

View File

@@ -34,9 +34,6 @@ class TestUploadUtils(base.StoreClearingUnitTest):
super(TestUploadUtils, self).setUp()
self.config(debug=True)
def tearDown(self):
super(TestUploadUtils, self).tearDown()
def test_initiate_delete(self):
req = unit_test_utils.get_fake_request()
location = {"url": "file://foo/bar",

View File

@@ -733,10 +733,6 @@ class TestRegistryV2ClientApi(base.IsolatedUnitTest):
super(TestRegistryV2ClientApi, self).setUp()
reload_module(rapi)
def tearDown(self):
"""Clear the test environment"""
super(TestRegistryV2ClientApi, self).tearDown()
def test_configure_registry_client_not_using_use_user_token(self):
self.config(use_user_token=False)
with patch.object(rapi,