Rename the test class so it will be PyCharm friendly

In order to run from PyCharm test classed need to end or start
with the word 'Test'

Change-Id: I85b9cc76ad7c10a9ffac7ae61232460381723b8f
This commit is contained in:
Eyal 2019-07-30 17:43:45 +03:00
parent c77eeb2d14
commit 77118d3bb9
14 changed files with 32 additions and 32 deletions

View File

@ -18,10 +18,10 @@ from mistral.tests.unit import base
from mistral.tests.unit.mstrlfixtures import policy_fixtures
class PolicyTestCase(base.BaseTest):
class PolicyTest(base.BaseTest):
"""Tests whether the configuration of the policy engine is correct."""
def setUp(self):
super(PolicyTestCase, self).setUp()
super(PolicyTest, self).setUp()
self.policy = self.useFixture(policy_fixtures.PolicyFixture())

View File

@ -39,18 +39,18 @@ cfg.CONF.set_default('auth_enable', False, group='pecan')
'run_action',
mock.MagicMock(return_value=None)
)
class LocalExecutorTestCase(base.ExecutorTestCase):
class LocalExecutorTest(base.ExecutorTestCase):
@classmethod
def setUpClass(cls):
super(LocalExecutorTestCase, cls).setUpClass()
super(LocalExecutorTest, cls).setUpClass()
cfg.CONF.set_default('type', 'local', group='executor')
@classmethod
def tearDownClass(cls):
exe.cleanup()
cfg.CONF.set_default('type', 'remote', group='executor')
super(LocalExecutorTestCase, cls).tearDownClass()
super(LocalExecutorTest, cls).tearDownClass()
@mock.patch.object(
std_actions.EchoAction,

View File

@ -25,11 +25,11 @@ from mistral.tests.unit.executors import base
LOG = logging.getLogger(__name__)
class PluginTestCase(base.ExecutorTestCase):
class PluginTest(base.ExecutorTestCase):
def tearDown(self):
exe.cleanup()
super(PluginTestCase, self).tearDown()
super(PluginTest, self).tearDown()
def test_get_local_executor(self):
executor = exe.get_executor('local')

View File

@ -19,7 +19,7 @@ from mistral.tests.unit.lang.v2 import base
from mistral import utils
class ActionSpecValidation(base.WorkbookSpecValidationTestCase):
class ActionSpecValidationTest(base.WorkbookSpecValidationTestCase):
def test_base_required(self):
actions = {'actions': {'a1': {}}}

View File

@ -19,7 +19,7 @@ from mistral.tests.unit.lang.v2 import base as v2_base
from mistral import utils
class TaskSpecValidation(v2_base.WorkflowSpecValidationTestCase):
class TaskSpecValidationTest(v2_base.WorkflowSpecValidationTestCase):
def test_type_injection(self):
tests = [
({'type': 'direct'}, False),

View File

@ -23,7 +23,7 @@ from mistral.lang.v2 import workbook
from mistral.tests.unit.lang.v2 import base
class WorkbookSpecValidation(base.WorkbookSpecValidationTestCase):
class WorkbookSpecValidationTest(base.WorkbookSpecValidationTestCase):
def test_build_valid_workbook_spec(self):
wb_spec = self._parse_dsl_spec(dsl_file='my_workbook.yaml')

View File

@ -22,7 +22,7 @@ from mistral.tests.unit.lang.v2 import base
from mistral import utils
class WorkflowSpecValidation(base.WorkflowSpecValidationTestCase):
class WorkflowSpecValidationTest(base.WorkflowSpecValidationTestCase):
def test_workflow_types(self):
tests = [
({'type': 'direct'}, False),

View File

@ -45,11 +45,11 @@ def notifier_process(ex_id, data, event, timestamp, publishers):
EVENT_LOGS.append((ex_id, event))
class ServerPluginTestCase(base.NotifierTestCase):
class ServerPluginTest(base.NotifierTestCase):
def tearDown(self):
notif.cleanup()
super(ServerPluginTestCase, self).tearDown()
super(ServerPluginTest, self).tearDown()
def test_get_bad_notifier(self):
self.assertRaises(sd_exc.NoMatches, notif.get_notifier, 'foobar')
@ -60,20 +60,20 @@ class ServerPluginTestCase(base.NotifierTestCase):
'notify',
mock.MagicMock(return_value=None)
)
class LocalNotifServerTestCase(base.NotifierTestCase):
class LocalNotifServerTest(base.NotifierTestCase):
@classmethod
def setUpClass(cls):
super(LocalNotifServerTestCase, cls).setUpClass()
super(LocalNotifServerTest, cls).setUpClass()
cfg.CONF.set_default('type', 'local', group='notifier')
@classmethod
def tearDownClass(cls):
cfg.CONF.set_default('type', 'remote', group='notifier')
super(LocalNotifServerTestCase, cls).tearDownClass()
super(LocalNotifServerTest, cls).tearDownClass()
def setUp(self):
super(LocalNotifServerTestCase, self).setUp()
super(LocalNotifServerTest, self).setUp()
self.publisher = notif.get_notification_publisher('webhook')
self.publisher.publish = mock.MagicMock(side_effect=publisher_process)
self.publisher.publish.reset_mock()
@ -81,7 +81,7 @@ class LocalNotifServerTestCase(base.NotifierTestCase):
def tearDown(self):
notif.cleanup()
super(LocalNotifServerTestCase, self).tearDown()
super(LocalNotifServerTest, self).tearDown()
def test_get_notifier(self):
notifier = notif.get_notifier(cfg.CONF.notifier.type)
@ -149,20 +149,20 @@ class LocalNotifServerTestCase(base.NotifierTestCase):
'notify',
mock.MagicMock(side_effect=notifier_process)
)
class RemoteNotifServerTestCase(base.NotifierTestCase):
class RemoteNotifServerTest(base.NotifierTestCase):
@classmethod
def setUpClass(cls):
super(RemoteNotifServerTestCase, cls).setUpClass()
super(RemoteNotifServerTest, cls).setUpClass()
cfg.CONF.set_default('type', 'remote', group='notifier')
def setUp(self):
super(RemoteNotifServerTestCase, self).setUp()
super(RemoteNotifServerTest, self).setUp()
del EVENT_LOGS[:]
def tearDown(self):
notif.cleanup()
super(RemoteNotifServerTestCase, self).tearDown()
super(RemoteNotifServerTest, self).tearDown()
def test_get_notifier(self):
notifier = notif.get_notifier(cfg.CONF.notifier.type)

View File

@ -29,12 +29,12 @@ class TestException(exc.MistralException):
pass
class KombuClientTestCase(base.KombuTestCase):
class KombuClientTest(base.KombuTestCase):
_RESPONSE = "response"
def setUp(self):
super(KombuClientTestCase, self).setUp()
super(KombuClientTest, self).setUp()
conf = mock.MagicMock()

View File

@ -31,10 +31,10 @@ VIRTUAL_HOST_1 = 'vhost_1'
VIRTUAL_HOST_2 = 'vhost_2'
class KombuHostsTestCase(base.BaseTest):
class KombuHostsTest(base.BaseTest):
def setUp(self):
super(KombuHostsTestCase, self).setUp()
super(KombuHostsTest, self).setUp()
# Oslo messaging set a default config option
oslo_messaging.get_transport(cfg.CONF)

View File

@ -30,10 +30,10 @@ class TestException(exc.MistralException):
pass
class KombuListenerTestCase(base.KombuTestCase):
class KombuListenerTest(base.KombuTestCase):
def setUp(self):
super(KombuListenerTestCase, self).setUp()
super(KombuListenerTest, self).setUp()
self.listener = kombu_listener.KombuRPCListener(
[mock.MagicMock()],

View File

@ -31,10 +31,10 @@ class TestException(exc.MistralError):
pass
class KombuServerTestCase(base.KombuTestCase):
class KombuServerTest(base.KombuTestCase):
def setUp(self):
super(KombuServerTestCase, self).setUp()
super(KombuServerTest, self).setUp()
self.conf = mock.MagicMock()
self.server = kombu_server.KombuRPCServer(self.conf)

View File

@ -15,7 +15,7 @@ from mistral import exceptions
from mistral.tests.unit.engine import base
class ContextTestCase(base.EngineTestCase):
class ContextTest(base.EngineTestCase):
def test_target_insecure(self):
# Defaults to False if X-Target-Auth-Uri isn't passed.

View File

@ -19,7 +19,7 @@ from mistral.tests.unit import base
from mistral.utils import inspect_utils
class ExceptionTestCase(base.BaseTest):
class ExceptionTest(base.BaseTest):
"""Test cases for exception code."""
def test_nf_with_message(self):