Fix tox.ini for conductor
Add .gitreview Change-Id: I43a947d083d80a9fba0d1663658a795ef959d935
This commit is contained in:
parent
5e4df0e2a5
commit
60749e0200
4
.gitreview
Normal file
4
.gitreview
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[gerrit]
|
||||||
|
host=review.openstack.org
|
||||||
|
port=29418
|
||||||
|
project=stackforge/murano-conductor.git
|
@ -24,7 +24,6 @@ from conductor.commands.cloud_formation import HeatExecutor
|
|||||||
|
|
||||||
|
|
||||||
class TestHeatExecutor(unittest.TestCase):
|
class TestHeatExecutor(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.mfs = mockfs.replace_builtins()
|
self.mfs = mockfs.replace_builtins()
|
||||||
template = {
|
template = {
|
||||||
@ -48,8 +47,6 @@ class TestHeatExecutor(unittest.TestCase):
|
|||||||
'endpoints': [{'publicURL': 'http://invalid.heat.url'}]
|
'endpoints': [{'publicURL': 'http://invalid.heat.url'}]
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@mock.patch('heatclient.v1.client.Client')
|
@mock.patch('heatclient.v1.client.Client')
|
||||||
@mock.patch('keystoneclient.v2_0.client.Client')
|
@mock.patch('keystoneclient.v2_0.client.Client')
|
||||||
@mock.patch('conductor.config.CONF')
|
@mock.patch('conductor.config.CONF')
|
||||||
@ -70,7 +67,6 @@ class TestHeatExecutor(unittest.TestCase):
|
|||||||
'arg2': 'arg2Value'},
|
'arg2': 'arg2Value'},
|
||||||
callback=callback)
|
callback=callback)
|
||||||
|
|
||||||
|
|
||||||
heat_mock().stacks.get().stack_status = 'CREATE_COMPLETE'
|
heat_mock().stacks.get().stack_status = 'CREATE_COMPLETE'
|
||||||
heat_mock().stacks.template = mock.MagicMock(
|
heat_mock().stacks.template = mock.MagicMock(
|
||||||
side_effect=heatclient.exc.HTTPNotFound)
|
side_effect=heatclient.exc.HTTPNotFound)
|
||||||
@ -125,9 +121,7 @@ class TestHeatExecutor(unittest.TestCase):
|
|||||||
get_mock._status_index += 1
|
get_mock._status_index += 1
|
||||||
return get_mock
|
return get_mock
|
||||||
|
|
||||||
|
|
||||||
heat_mock().stacks.get = mock.MagicMock(side_effect=side_effect)
|
heat_mock().stacks.get = mock.MagicMock(side_effect=side_effect)
|
||||||
|
|
||||||
heat_mock().stacks.template = mock.MagicMock(
|
heat_mock().stacks.template = mock.MagicMock(
|
||||||
return_value={'instance': {}})
|
return_value={'instance': {}})
|
||||||
|
|
||||||
@ -160,7 +154,6 @@ class TestHeatExecutor(unittest.TestCase):
|
|||||||
command='Delete',
|
command='Delete',
|
||||||
callback=callback)
|
callback=callback)
|
||||||
|
|
||||||
|
|
||||||
heat_mock().stacks.get = mock.MagicMock(
|
heat_mock().stacks.get = mock.MagicMock(
|
||||||
side_effect=heatclient.exc.HTTPNotFound)
|
side_effect=heatclient.exc.HTTPNotFound)
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ import conductor.rabbitmq as rabbitmq
|
|||||||
from conductor.workflow import Workflow
|
from conductor.workflow import Workflow
|
||||||
import conductor.xml_code_engine as engine
|
import conductor.xml_code_engine as engine
|
||||||
|
|
||||||
class TestMethodsAndClasses(unittest.TestCase):
|
|
||||||
|
|
||||||
|
class TestMethodsAndClasses(unittest.TestCase):
|
||||||
def test_init_service_class(self):
|
def test_init_service_class(self):
|
||||||
con = ConductorWorkflowService()
|
con = ConductorWorkflowService()
|
||||||
|
|
||||||
|
@ -17,10 +17,9 @@ import unittest
|
|||||||
from conductor.app import ConductorWorkflowService
|
from conductor.app import ConductorWorkflowService
|
||||||
from conductor.openstack.common import service
|
from conductor.openstack.common import service
|
||||||
|
|
||||||
class TestMethodsAndClasses(unittest.TestCase):
|
|
||||||
|
|
||||||
|
class TestMethodsAndClasses(unittest.TestCase):
|
||||||
def test_init_service_class(self):
|
def test_init_service_class(self):
|
||||||
launcher = service.ServiceLauncher()
|
launcher = service.ServiceLauncher()
|
||||||
con = ConductorWorkflowService()
|
con = ConductorWorkflowService()
|
||||||
launcher.launch_service(con)
|
launcher.launch_service(con)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class TestWorkflow(unittest.TestCase):
|
|||||||
def test_empty_workflow_leaves_object_model_unchanged(self):
|
def test_empty_workflow_leaves_object_model_unchanged(self):
|
||||||
xml = '<workflow/>'
|
xml = '<workflow/>'
|
||||||
self._execute_workflow(xml)
|
self._execute_workflow(xml)
|
||||||
self.assertIsNone(deep.diff(self.original_model, self.model))
|
self.assertTrue(deep.diff(self.original_model, self.model) is None)
|
||||||
|
|
||||||
def test_modifying_object_model_from_workflow(self):
|
def test_modifying_object_model_from_workflow(self):
|
||||||
xml = '''
|
xml = '''
|
||||||
@ -63,8 +63,8 @@ class TestWorkflow(unittest.TestCase):
|
|||||||
</rule>
|
</rule>
|
||||||
</workflow>
|
</workflow>
|
||||||
'''
|
'''
|
||||||
self.assertNotIn(
|
self.assertFalse(
|
||||||
'state',
|
'state' in
|
||||||
self.model['services']['activeDirectories'][0])
|
self.model['services']['activeDirectories'][0])
|
||||||
|
|
||||||
self._execute_workflow(xml)
|
self._execute_workflow(xml)
|
||||||
@ -73,9 +73,9 @@ class TestWorkflow(unittest.TestCase):
|
|||||||
self.model['services']['activeDirectories'][0]['state']['invalid'],
|
self.model['services']['activeDirectories'][0]['state']['invalid'],
|
||||||
'value')
|
'value')
|
||||||
|
|
||||||
self.assertIsNotNone(deep.diff(self.original_model, self.model))
|
self.assertFalse(deep.diff(self.original_model, self.model) is None)
|
||||||
del self.model['services']['activeDirectories'][0]['state']
|
del self.model['services']['activeDirectories'][0]['state']
|
||||||
self.assertIsNone(deep.diff(self.original_model, self.model))
|
self.assertTrue(deep.diff(self.original_model, self.model) is None)
|
||||||
|
|
||||||
def test_selecting_properties_from_object_model_within_workflow(self):
|
def test_selecting_properties_from_object_model_within_workflow(self):
|
||||||
xml = '''
|
xml = '''
|
||||||
@ -96,4 +96,3 @@ class TestWorkflow(unittest.TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.model['services']['activeDirectories'][0]['test'],
|
self.model['services']['activeDirectories'][0]['test'],
|
||||||
'Domain acme.loc with primary DC dc01')
|
'Domain acme.loc with primary DC dc01')
|
||||||
|
|
||||||
|
14
tox.ini
14
tox.ini
@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py27,pep8
|
envlist = py26,py27,pep8,pyflakes
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
@ -44,3 +44,15 @@ commands = nosetests --cover-erase --cover-package=conductor --with-xcoverage
|
|||||||
deps = file://{toxinidir}/.cache.bundle
|
deps = file://{toxinidir}/.cache.bundle
|
||||||
setenv = NOSE_WITH_XUNIT=1
|
setenv = NOSE_WITH_XUNIT=1
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
|
[testenv:pyflakes]
|
||||||
|
deps = flake8
|
||||||
|
commands = flake8
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
# H301 one import per line
|
||||||
|
# H302 import only modules
|
||||||
|
ignore = H301,H302,F401
|
||||||
|
show-source = true
|
||||||
|
builtins = _
|
||||||
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
|
Loading…
Reference in New Issue
Block a user