aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/tempest/test_tempest.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-10-21 17:03:51 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-10-21 17:44:30 +0200
commit4d3627e56d333e313b67bbf1e7880b11883b5652 (patch)
tree1a2a8e02d1abddfc7ba03d0c6e12095547245092 /functest/tests/unit/openstack/tempest/test_tempest.py
parent6939526b9802539a62f71ca7759f7bd49c16aef4 (diff)
Harden Rally generate report
It converts html_file to str and raises all possible exceptions. It sometimes fails when locally generating reports. Change-Id: Idf6a12aaac4561800cd5e364f8bcc495aabbee1d 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.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py
index c87c0b085..67e7dd431 100644
--- a/functest/tests/unit/openstack/tempest/test_tempest.py
+++ b/functest/tests/unit/openstack/tempest/test_tempest.py
@@ -170,8 +170,7 @@ class OSTempestTesting(unittest.TestCase):
mock_logger_info. \
assert_any_call("Starting Tempest test suite: '%s'.", cmd)
- @mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
- 'subprocess.Popen')
+ @mock.patch('subprocess.check_output')
def test_generate_report(self, mock_popen):
self.tempestcommon.verification_id = "1234"
html_file = os.path.join(
@@ -182,8 +181,7 @@ class OSTempestTesting(unittest.TestCase):
cmd = ["rally", "verify", "report", "--type", "html", "--uuid",
"1234", "--to", html_file]
self.tempestcommon.generate_report()
- mock_popen.assert_called_once_with(cmd, stdout=mock.ANY,
- stderr=mock.ANY)
+ mock_popen.assert_called_once_with(cmd)
@mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'os.path.exists', return_value=False)