aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/tempest/test_tempest.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-03-01 15:20:10 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-03-02 09:31:43 +0100
commit5cb9051a0418815636a1d5df66940e168c4e0a56 (patch)
tree04e2c7a4361f36b324fb8a11ccaa448b229ba68c /functest/tests/unit/openstack/tempest/test_tempest.py
parent67363022f2139fea4049743bc00b32cf8e5f453e (diff)
Leverage on Xtesting
It removes all the files which have moved to Xtesting. Vnf inheritances and env management will be improved in other changes. It keeps the same tree thanks to a symlink to allow publishing artifacts. Change-Id: I551bbd3f344cdab0158a50b7b09e541576695631 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/openstack/tempest/test_tempest.py')
-rw-r--r--functest/tests/unit/openstack/tempest/test_tempest.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py
index ba2c1c48f..8600506ad 100644
--- a/functest/tests/unit/openstack/tempest/test_tempest.py
+++ b/functest/tests/unit/openstack/tempest/test_tempest.py
@@ -12,13 +12,12 @@ import os
import unittest
import mock
+from snaps.openstack.os_credentials import OSCreds
+from xtesting.core import testcase
-from functest.core import testcase
from functest.opnfv_tests.openstack.tempest import tempest
from functest.opnfv_tests.openstack.tempest import conf_utils
-from snaps.openstack.os_credentials import OSCreds
-
class OSTempestTesting(unittest.TestCase):
@@ -72,7 +71,8 @@ class OSTempestTesting(unittest.TestCase):
self.tempestcommon.generate_test_list('test_verifier_repo_dir')
self.assertTrue(mock_copyfile.called)
- def _test_gen_tl_mode_default(self, mode):
+ @mock.patch('functest.utils.functest_utils.execute_command')
+ def _test_gen_tl_mode_default(self, mode, mock_exec=None):
self.tempestcommon.mode = mode
if self.tempestcommon.mode == 'smoke':
testr_mode = r"'tempest\.(api|scenario).*\[.*\bsmoke\b.*\]'"
@@ -82,14 +82,12 @@ class OSTempestTesting(unittest.TestCase):
testr_mode = 'tempest.api.' + self.tempestcommon.mode
conf_utils.TEMPEST_RAW_LIST = 'raw_list'
verifier_repo_dir = 'test_verifier_repo_dir'
- with mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
- 'ft_utils.execute_command') as mock_exec:
- cmd = ("cd {0};"
- "testr list-tests {1} > {2};"
- "cd -;".format(verifier_repo_dir, testr_mode,
- conf_utils.TEMPEST_RAW_LIST))
- self.tempestcommon.generate_test_list('test_verifier_repo_dir')
- mock_exec.assert_any_call(cmd)
+ cmd = ("cd {0};"
+ "testr list-tests {1} > {2};"
+ "cd -;".format(verifier_repo_dir, testr_mode,
+ conf_utils.TEMPEST_RAW_LIST))
+ self.tempestcommon.generate_test_list('test_verifier_repo_dir')
+ mock_exec.assert_any_call(cmd)
def test_gen_tl_smoke_mode(self):
self._test_gen_tl_mode_default('smoke')
@@ -221,9 +219,9 @@ class OSTempestTesting(unittest.TestCase):
def test_run_apply_blacklist_ko(self):
with mock.patch.object(self.tempestcommon, 'generate_test_list'), \
- mock.patch.object(self.tempestcommon,
- 'apply_tempest_blacklist',
- side_effect=Exception()):
+ mock.patch.object(
+ self.tempestcommon, 'apply_tempest_blacklist',
+ side_effect=Exception()):
self._test_run(testcase.TestCase.EX_RUN_ERROR)
def test_run_verifier_tests_ko(self):