summaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/rally/test_rally.py
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2018-08-14 16:00:58 +0300
committerCédric Ollivier <cedric.ollivier@orange.com>2018-08-16 10:56:12 +0200
commitca46e50190055c9752847d89d044e9fc6c307e81 (patch)
treecd50f915bec7ac4a5072c109aa27b3de3d2a6ee0 /functest/tests/unit/openstack/rally/test_rally.py
parent86656df19a9496c18ad1b40eaba65a425eb494ea (diff)
Create new project/user for rally test
FUNCTEST-1002 Change-Id: Id19b9aa70aeded6d99978084b3de4a63e31a81ad Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com> (cherry picked from commit 4b7d89de42fe9a3867b12ea39721ad92aff96340)
Diffstat (limited to 'functest/tests/unit/openstack/rally/test_rally.py')
-rw-r--r--functest/tests/unit/openstack/rally/test_rally.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py
index 6a9581af0..34c6818b4 100644
--- a/functest/tests/unit/openstack/rally/test_rally.py
+++ b/functest/tests/unit/openstack/rally/test_rally.py
@@ -23,12 +23,15 @@ class OSRallyTesting(unittest.TestCase):
# pylint: disable=too-many-public-methods
def setUp(self):
with mock.patch('os_client_config.get_config'), \
- mock.patch('shade.OperatorCloud') as mock_shade:
+ mock.patch('shade.OperatorCloud') as mock_shade, \
+ mock.patch('functest.core.tenantnetwork.NewProject') \
+ as mock_new_project:
self.rally_base = rally.RallyBase()
self.rally_base.image = munch.Munch(name='foo')
self.rally_base.flavor = munch.Munch(name='foo')
self.rally_base.flavor_alt = munch.Munch(name='bar')
self.assertTrue(mock_shade.called)
+ self.assertTrue(mock_new_project.called)
def test_build_task_args_missing_floating_network(self):
os.environ['OS_AUTH_URL'] = ''
@@ -293,16 +296,13 @@ class OSRallyTesting(unittest.TestCase):
self.rally_base.test_name = 'test1'
with mock.patch.object(self.rally_base.cloud,
'list_hypervisors') as mock_list_hyperv, \
- mock.patch.object(self.rally_base.cloud,
- 'set_flavor_specs') as mock_set_flavor_specs, \
- mock.patch.object(self.rally_base.cloud, 'create_flavor',
+ mock.patch.object(self.rally_base, 'create_flavor_alt',
side_effect=Exception) \
as mock_create_flavor:
with self.assertRaises(Exception):
self.rally_base._prepare_env()
mock_list_hyperv.assert_called_once()
mock_create_flavor.assert_called_once()
- mock_set_flavor_specs.assert_not_called()
@mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
'_run_task')
@@ -322,7 +322,7 @@ class OSRallyTesting(unittest.TestCase):
mock_run_task.assert_any_call('test1')
def test_clean_up_default(self):
- with mock.patch.object(self.rally_base.cloud,
+ with mock.patch.object(self.rally_base.orig_cloud,
'delete_flavor') as mock_delete_flavor:
self.rally_base.flavor_alt = mock.Mock()
self.rally_base.clean()