Remove deprecated test.idempotent_id decorator
All active tempest plugin now switched to use idempotent_id from tempest.lib.decorators Only usgae left is in 'networking-plumgrid' and x/valet tempest plugin, both are blacklisted plugins. - https://docs.openstack.org/tempest/latest/plugins/plugin-registry.html#blacklisted-plugins networking-plumgrid fix is not merged since 3 years. -I4872dbde4364692d49a98922cfb18beb784e77c3 We are safe to remove deprecated tempest.test.related_bug. Change-Id: Iae3f3120de0fea9664e99fab59086f1a4994ae55
This commit is contained in:
parent
fec2c93cdc
commit
57d56faded
|
@ -38,12 +38,6 @@ LOG = logging.getLogger(__name__)
|
|||
|
||||
CONF = config.CONF
|
||||
|
||||
# TODO(oomichi): This test.idempotent_id should be removed after all projects
|
||||
# switch to use decorators.idempotent_id.
|
||||
idempotent_id = debtcollector.moves.moved_function(
|
||||
decorators.idempotent_id, 'idempotent_id', __name__,
|
||||
version='Mitaka', removal_version='?')
|
||||
|
||||
|
||||
attr = debtcollector.moves.moved_function(
|
||||
decorators.attr, 'attr', __name__,
|
||||
|
|
|
@ -19,7 +19,6 @@ import testtools
|
|||
from tempest.common import utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest import test
|
||||
from tempest.tests import base
|
||||
from tempest.tests import fake_config
|
||||
|
@ -33,47 +32,6 @@ class BaseDecoratorsTest(base.TestCase):
|
|||
fake_config.FakePrivate)
|
||||
|
||||
|
||||
# NOTE: The test module is for tempest.test.idempotent_id.
|
||||
# After all projects switch to use decorators.idempotent_id,
|
||||
# we can remove tempest.test.idempotent_id as well as this
|
||||
# test module
|
||||
class TestIdempotentIdDecorator(BaseDecoratorsTest):
|
||||
|
||||
def _test_helper(self, _id, **decorator_args):
|
||||
@test.idempotent_id(_id)
|
||||
def foo():
|
||||
"""Docstring"""
|
||||
pass
|
||||
|
||||
return foo
|
||||
|
||||
def _test_helper_without_doc(self, _id, **decorator_args):
|
||||
@test.idempotent_id(_id)
|
||||
def foo():
|
||||
pass
|
||||
|
||||
return foo
|
||||
|
||||
def test_positive(self):
|
||||
_id = data_utils.rand_uuid()
|
||||
foo = self._test_helper(_id)
|
||||
self.assertIn('id-%s' % _id, getattr(foo, '__testtools_attrs'))
|
||||
self.assertTrue(foo.__doc__.startswith('Test idempotent id: %s' % _id))
|
||||
|
||||
def test_positive_without_doc(self):
|
||||
_id = data_utils.rand_uuid()
|
||||
foo = self._test_helper_without_doc(_id)
|
||||
self.assertTrue(foo.__doc__.startswith('Test idempotent id: %s' % _id))
|
||||
|
||||
def test_idempotent_id_not_str(self):
|
||||
_id = 42
|
||||
self.assertRaises(TypeError, self._test_helper, _id)
|
||||
|
||||
def test_idempotent_id_not_valid_uuid(self):
|
||||
_id = '42'
|
||||
self.assertRaises(ValueError, self._test_helper, _id)
|
||||
|
||||
|
||||
class TestServicesDecorator(BaseDecoratorsTest):
|
||||
def _test_services_helper(self, *decorator_args):
|
||||
class TestFoo(test.BaseTestCase):
|
||||
|
|
Loading…
Reference in New Issue