diff options
author | 2019-05-24 22:08:50 +0200 | |
---|---|---|
committer | 2019-05-24 22:12:32 +0200 | |
commit | a02c3601c488f6bdd6e57e7cebeb00f7daf8f1c9 (patch) | |
tree | c35e0ed4963ee06a514e81519d6bdf68bbe7e5f7 /functest/tests/unit/openstack | |
parent | fb0717f345c42b58d0c5f3cf4f8510892755ac6a (diff) |
Decode Bytes in logging calls
It fixes a few incorrect types in log calls [1].
[1] https://build.opnfv.org/ci/view/functest/job/functest-latest-daily/163/
Change-Id: I01790f6454694f434d31366f9c1cf9d98ff5a9cf
Signed-off-by: Cédric Ollivier <ollivier.cedric@gmail.com>
(cherry picked from commit 7d58f89103a8c44fd166c3e06b492ade63e5c5b3)
Diffstat (limited to 'functest/tests/unit/openstack')
-rw-r--r-- | functest/tests/unit/openstack/rally/test_rally.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py index fb463c55c..87c429b9e 100644 --- a/functest/tests/unit/openstack/rally/test_rally.py +++ b/functest/tests/unit/openstack/rally/test_rally.py @@ -78,10 +78,13 @@ class OSRallyTesting(unittest.TestCase): calls = [ mock.call(['rally', 'deployment', 'destroy', '--deployment', str(getattr(config.CONF, 'rally_deployment_name'))]), + mock.call().decode(), mock.call(['rally', 'deployment', 'create', '--fromenv', '--name', str(getattr(config.CONF, 'rally_deployment_name'))], env=None), - mock.call(['rally', 'deployment', 'check'])] + mock.call().decode(), + mock.call(['rally', 'deployment', 'check']), + mock.call().decode()] mock_exec.assert_has_calls(calls) @mock.patch('functest.opnfv_tests.openstack.rally.rally.os.path.exists') @@ -414,7 +417,7 @@ class OSRallyTesting(unittest.TestCase): "--to", file_name] args[0].assert_called_with(cmd, stderr=subprocess.STDOUT) - @mock.patch('subprocess.check_output', return_value=None) + @mock.patch('subprocess.check_output', return_value=b'') def test_export_task(self, *args): file_name = "{}/{}.html".format( self.rally_base.results_dir, self.rally_base.case_name) @@ -435,7 +438,7 @@ class OSRallyTesting(unittest.TestCase): "--to", file_name] args[0].assert_called_with(cmd, stderr=subprocess.STDOUT) - @mock.patch('subprocess.check_output', return_value=None) + @mock.patch('subprocess.check_output', return_value=b'') def test_verify_report(self, *args): file_name = "{}/{}.html".format( self.rally_base.results_dir, self.rally_base.case_name) |