diff options
author | Kubi <jean.gaoliang@huawei.com> | 2017-07-06 12:14:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-07-06 12:14:34 +0000 |
commit | 2bea82e39d62246552a9d6d49c74bbc32747f018 (patch) | |
tree | 4a83bfb2b001f7ef4ab51933c91e51df4a848755 /tests/unit/benchmark/scenarios/compute/test_lmbench.py | |
parent | 917dea49415183eaff6d2f2fbf32ddeff64d9dfe (diff) | |
parent | 25a37b2048281c64719bd6ad67860f65f6c31546 (diff) |
Merge "move flatten dict key to common utils"
Diffstat (limited to 'tests/unit/benchmark/scenarios/compute/test_lmbench.py')
-rw-r--r-- | tests/unit/benchmark/scenarios/compute/test_lmbench.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/unit/benchmark/scenarios/compute/test_lmbench.py b/tests/unit/benchmark/scenarios/compute/test_lmbench.py index 08f5da332..65939c6ba 100644 --- a/tests/unit/benchmark/scenarios/compute/test_lmbench.py +++ b/tests/unit/benchmark/scenarios/compute/test_lmbench.py @@ -68,8 +68,7 @@ class LmbenchTestCase(unittest.TestCase): sample_output = '[{"latency": 4.944, "size": 0.00049}]' mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') l.run(self.result) - expected_result = jsonutils.loads( - '{"latencies": ' + sample_output + "}") + expected_result = {"latencies0.latency": 4.944, "latencies0.size": 0.00049} self.assertEqual(self.result, expected_result) def test_successful_bandwidth_run_no_sla(self, mock_ssh): @@ -105,8 +104,7 @@ class LmbenchTestCase(unittest.TestCase): sample_output = '[{"latency": 4.944, "size": 0.00049}]' mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') l.run(self.result) - expected_result = jsonutils.loads( - '{"latencies": ' + sample_output + "}") + expected_result = {"latencies0.latency": 4.944, "latencies0.size": 0.00049} self.assertEqual(self.result, expected_result) def test_successful_bandwidth_run_sla(self, mock_ssh): @@ -191,3 +189,10 @@ class LmbenchTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, l.run, self.result) + + +def main(): + unittest.main() + +if __name__ == '__main__': + main() |