Removed unnecessary setUp() calls in tests
Basically, if you decide to override a method, that is because you want to specify(or modify) the behavior of a method. If you just call the inherited method from the overridden method, that is unnecessary. Furthermore, every time when self.setUp() is called, now the super's setUp() is called, which is basically exact the same behavior as we have now. TrivialFix Change-Id: I9f4e03b93ff075c66b4e52342711c37f226d2f81
This commit is contained in:
parent
e979d19458
commit
98255e6715
@ -27,9 +27,6 @@ from manila.tests import db_utils
|
|||||||
class ShareTestCase(test.TestCase):
|
class ShareTestCase(test.TestCase):
|
||||||
"""Testing of SQLAlchemy Share model class."""
|
"""Testing of SQLAlchemy Share model class."""
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(ShareTestCase, self).setUp()
|
|
||||||
|
|
||||||
@ddt.data(constants.STATUS_MANAGE_ERROR, constants.STATUS_CREATING,
|
@ddt.data(constants.STATUS_MANAGE_ERROR, constants.STATUS_CREATING,
|
||||||
constants.STATUS_EXTENDING, constants.STATUS_DELETING,
|
constants.STATUS_EXTENDING, constants.STATUS_DELETING,
|
||||||
constants.STATUS_EXTENDING_ERROR,
|
constants.STATUS_EXTENDING_ERROR,
|
||||||
|
@ -30,9 +30,6 @@ CONF = cfg.CONF
|
|||||||
|
|
||||||
class SchedulerRpcAPITestCase(test.TestCase):
|
class SchedulerRpcAPITestCase(test.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(SchedulerRpcAPITestCase, self).setUp()
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
super(SchedulerRpcAPITestCase, self).tearDown()
|
super(SchedulerRpcAPITestCase, self).tearDown()
|
||||||
|
|
||||||
|
@ -27,9 +27,6 @@ from manila import test
|
|||||||
class UtilsTestCase(test.TestCase):
|
class UtilsTestCase(test.TestCase):
|
||||||
"""Test case for utils."""
|
"""Test case for utils."""
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(UtilsTestCase, self).setUp()
|
|
||||||
|
|
||||||
@ddt.data(
|
@ddt.data(
|
||||||
({'extra_specs': {'thin_provisioning': True}}, True),
|
({'extra_specs': {'thin_provisioning': True}}, True),
|
||||||
({'extra_specs': {'thin_provisioning': False}}, False),
|
({'extra_specs': {'thin_provisioning': False}}, False),
|
||||||
|
@ -30,9 +30,6 @@ from manila.tests.share.drivers.hpe import test_hpe_3par_constants as constants
|
|||||||
@ddt.ddt
|
@ddt.ddt
|
||||||
class HPE3ParDriverFPGTestCase(test.TestCase):
|
class HPE3ParDriverFPGTestCase(test.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(HPE3ParDriverFPGTestCase, self).setUp()
|
|
||||||
|
|
||||||
@ddt.data((-1, 4),
|
@ddt.data((-1, 4),
|
||||||
(0, 5),
|
(0, 5),
|
||||||
(0, -1))
|
(0, -1))
|
||||||
|
@ -25,9 +25,6 @@ from manila.tests.share.drivers.netapp import fakes as na_fakes
|
|||||||
|
|
||||||
class NetAppDriverFactoryTestCase(test.TestCase):
|
class NetAppDriverFactoryTestCase(test.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(NetAppDriverFactoryTestCase, self).setUp()
|
|
||||||
|
|
||||||
def test_new(self):
|
def test_new(self):
|
||||||
|
|
||||||
self.mock_object(na_utils.OpenStackInfo, 'info',
|
self.mock_object(na_utils.OpenStackInfo, 'info',
|
||||||
|
@ -162,9 +162,6 @@ class OpenstackInfoTestCase(test.TestCase):
|
|||||||
DEB_RLS = 'upstream_version-debian_revision'
|
DEB_RLS = 'upstream_version-debian_revision'
|
||||||
DEB_VENDOR = 'debian_revision'
|
DEB_VENDOR = 'debian_revision'
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(OpenstackInfoTestCase, self).setUp()
|
|
||||||
|
|
||||||
def test_openstack_info_init(self):
|
def test_openstack_info_init(self):
|
||||||
info = na_utils.OpenStackInfo()
|
info = na_utils.OpenStackInfo()
|
||||||
|
|
||||||
|
@ -28,9 +28,6 @@ CONF.register_opt(cfg.StrOpt('conf_unittest',
|
|||||||
|
|
||||||
class ConfigTestCase(test.TestCase):
|
class ConfigTestCase(test.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(ConfigTestCase, self).setUp()
|
|
||||||
|
|
||||||
def test_declare(self):
|
def test_declare(self):
|
||||||
self.assertNotIn('answer', CONF)
|
self.assertNotIn('answer', CONF)
|
||||||
CONF.import_opt('answer', 'manila.tests.declare_conf')
|
CONF.import_opt('answer', 'manila.tests.declare_conf')
|
||||||
|
@ -21,9 +21,6 @@ from manila import test
|
|||||||
@ddt.ddt
|
@ddt.ddt
|
||||||
class RPCTestCase(test.TestCase):
|
class RPCTestCase(test.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(RPCTestCase, self).setUp()
|
|
||||||
|
|
||||||
@ddt.data([], ['noop'], ['noop', 'noop'])
|
@ddt.data([], ['noop'], ['noop', 'noop'])
|
||||||
@mock.patch('oslo_messaging.JsonPayloadSerializer', wraps=True)
|
@mock.patch('oslo_messaging.JsonPayloadSerializer', wraps=True)
|
||||||
def test_init_no_notifications(self, driver, serializer_mock):
|
def test_init_no_notifications(self, driver, serializer_mock):
|
||||||
|
@ -525,9 +525,6 @@ class TestComparableMixin(test.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class TestRetryDecorator(test.TestCase):
|
class TestRetryDecorator(test.TestCase):
|
||||||
def setUp(self):
|
|
||||||
super(TestRetryDecorator, self).setUp()
|
|
||||||
|
|
||||||
def test_no_retry_required(self):
|
def test_no_retry_required(self):
|
||||||
self.counter = 0
|
self.counter = 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user