diff options
author | Linda Wang <wangwulin@huawei.com> | 2018-01-17 01:12:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-01-17 01:12:45 +0000 |
commit | d181f61205869adef1b8763feb531cc3df52669f (patch) | |
tree | ac77a1bcf8e97eb200701d395a5670715e6950d7 /functest/tests/unit | |
parent | eb793907cee64bbe2519040559b04d47652cabf0 (diff) | |
parent | 1ef546ca2464dc9210522026bb95200b6abab47a (diff) |
Merge "Fix Rally output retrieval"
Diffstat (limited to 'functest/tests/unit')
-rw-r--r-- | functest/tests/unit/openstack/rally/test_rally.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py index 450eb85b..6b50daea 100644 --- a/functest/tests/unit/openstack/rally/test_rally.py +++ b/functest/tests/unit/openstack/rally/test_rally.py @@ -27,7 +27,6 @@ class OSRallyTesting(unittest.TestCase): with mock.patch('snaps.openstack.tests.openstack_tests.' 'get_credentials', return_value=os_creds) as m: self.rally_base = rally.RallyBase() - self.polling_iter = 2 self.assertTrue(m.called) def test_build_task_args_missing_floating_network(self): @@ -102,19 +101,11 @@ class OSRallyTesting(unittest.TestCase): self.assertEqual(self.rally_base.task_succeed(json_raw), True) - def polling(self): - if self.polling_iter == 0: - return "something" - self.polling_iter -= 1 - return None - def test_get_cmd_output(self): proc = mock.Mock() - attrs = {'poll.side_effect': self.polling, - 'stdout.readline.return_value': 'line'} - proc.configure_mock(**attrs) + proc.stdout.__iter__ = mock.Mock(return_value=iter(['line1', 'line2'])) self.assertEqual(self.rally_base.get_cmd_output(proc), - 'lineline') + 'line1line2') @mock.patch('__builtin__.open', mock.mock_open()) @mock.patch('functest.opnfv_tests.openstack.rally.rally.yaml.safe_load', |