Fix tox.ini for conductor

Add .gitreview

Change-Id: I43a947d083d80a9fba0d1663658a795ef959d935
This commit is contained in:
Serg Melikyan 2013-05-16 19:40:43 +04:00
parent 5e4df0e2a5
commit 60749e0200
6 changed files with 24 additions and 17 deletions

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=stackforge/murano-conductor.git

View File

@ -24,7 +24,6 @@ from conductor.commands.cloud_formation import HeatExecutor
class TestHeatExecutor(unittest.TestCase):
def setUp(self):
self.mfs = mockfs.replace_builtins()
template = {
@ -48,8 +47,6 @@ class TestHeatExecutor(unittest.TestCase):
'endpoints': [{'publicURL': 'http://invalid.heat.url'}]
}]
@mock.patch('heatclient.v1.client.Client')
@mock.patch('keystoneclient.v2_0.client.Client')
@mock.patch('conductor.config.CONF')
@ -70,7 +67,6 @@ class TestHeatExecutor(unittest.TestCase):
'arg2': 'arg2Value'},
callback=callback)
heat_mock().stacks.get().stack_status = 'CREATE_COMPLETE'
heat_mock().stacks.template = mock.MagicMock(
side_effect=heatclient.exc.HTTPNotFound)
@ -125,9 +121,7 @@ class TestHeatExecutor(unittest.TestCase):
get_mock._status_index += 1
return get_mock
heat_mock().stacks.get = mock.MagicMock(side_effect=side_effect)
heat_mock().stacks.template = mock.MagicMock(
return_value={'instance': {}})
@ -160,7 +154,6 @@ class TestHeatExecutor(unittest.TestCase):
command='Delete',
callback=callback)
heat_mock().stacks.get = mock.MagicMock(
side_effect=heatclient.exc.HTTPNotFound)

View File

@ -19,8 +19,8 @@ import conductor.rabbitmq as rabbitmq
from conductor.workflow import Workflow
import conductor.xml_code_engine as engine
class TestMethodsAndClasses(unittest.TestCase):
class TestMethodsAndClasses(unittest.TestCase):
def test_init_service_class(self):
con = ConductorWorkflowService()

View File

@ -17,10 +17,9 @@ import unittest
from conductor.app import ConductorWorkflowService
from conductor.openstack.common import service
class TestMethodsAndClasses(unittest.TestCase):
class TestMethodsAndClasses(unittest.TestCase):
def test_init_service_class(self):
launcher = service.ServiceLauncher()
con = ConductorWorkflowService()
launcher.launch_service(con)

View File

@ -51,7 +51,7 @@ class TestWorkflow(unittest.TestCase):
def test_empty_workflow_leaves_object_model_unchanged(self):
xml = '<workflow/>'
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):
xml = '''
@ -63,8 +63,8 @@ class TestWorkflow(unittest.TestCase):
</rule>
</workflow>
'''
self.assertNotIn(
'state',
self.assertFalse(
'state' in
self.model['services']['activeDirectories'][0])
self._execute_workflow(xml)
@ -73,9 +73,9 @@ class TestWorkflow(unittest.TestCase):
self.model['services']['activeDirectories'][0]['state']['invalid'],
'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']
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):
xml = '''
@ -96,4 +96,3 @@ class TestWorkflow(unittest.TestCase):
self.assertEqual(
self.model['services']['activeDirectories'][0]['test'],
'Domain acme.loc with primary DC dc01')

14
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
envlist = py27,pep8
envlist = py26,py27,pep8,pyflakes
[testenv]
setenv = VIRTUAL_ENV={envdir}
@ -44,3 +44,15 @@ commands = nosetests --cover-erase --cover-package=conductor --with-xcoverage
deps = file://{toxinidir}/.cache.bundle
setenv = NOSE_WITH_XUNIT=1
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