diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2017-06-30 02:32:55 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2017-06-30 05:06:26 +0000 |
commit | 1b9eeb504ed9416c74e1caf8975b51ee6af86b29 (patch) | |
tree | ebffc173b165e3d29a0f95aa2b687b163c67288a /tests/unit | |
parent | 9ba594fa3f34d551d34abd7582281ce081924c67 (diff) |
Change prepareYardstickEnv to prepare_env and add log info
JIRA: YARDSTICK-697
Currently the action in env like prepareYardstickEnv,
createGrafanaContainer, createInfluxDBContainer, this is not python style.
So I do some change:
prepareYardstickEnv->prepare_env
createGrafanaContainer->create_grafana
createInfluxDBContainer->create_influxdb
And also add some log info in env_action.
Change-Id: Ia91576b975f3de76b96e312779fda4911e7cac24
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/apiserver/resources/test_env_action.py | 2 | ||||
-rw-r--r-- | tests/unit/apiserver/utils/test_common.py | 25 | ||||
-rw-r--r-- | tests/unit/cmd/commands/test_env.py | 2 |
3 files changed, 2 insertions, 27 deletions
diff --git a/tests/unit/apiserver/resources/test_env_action.py b/tests/unit/apiserver/resources/test_env_action.py index c7ae10a20..d61092dbc 100644 --- a/tests/unit/apiserver/resources/test_env_action.py +++ b/tests/unit/apiserver/resources/test_env_action.py @@ -18,7 +18,7 @@ class EnvTestCase(APITestCase): def test_create_grafana(self): url = 'yardstick/env/action' - data = {'action': 'createGrafanaContainer'} + data = {'action': 'create_grafana'} resp = self._post(url, data) time.sleep(1) diff --git a/tests/unit/apiserver/utils/test_common.py b/tests/unit/apiserver/utils/test_common.py index acf6e41b1..ad81cb76b 100644 --- a/tests/unit/apiserver/utils/test_common.py +++ b/tests/unit/apiserver/utils/test_common.py @@ -33,31 +33,6 @@ class TranslateToStrTestCase(unittest.TestCase): self.assertEqual(result, output_str) -class GetCommandListTestCase(unittest.TestCase): - - def test_get_command_list_no_opts(self): - command_list = ['a'] - opts = {} - args = 'b' - output_list = common.get_command_list(command_list, opts, args) - - result_list = ['a', 'b'] - self.assertEqual(result_list, output_list) - - def test_get_command_list_with_opts_args(self): - command_list = ['a'] - opts = { - 'b': 'c', - 'task-args': 'd' - } - args = 'e' - - output_list = common.get_command_list(command_list, opts, args) - - result_list = ['a', 'e', '--b', '--task-args', 'd'] - self.assertEqual(result_list, output_list) - - def main(): unittest.main() diff --git a/tests/unit/cmd/commands/test_env.py b/tests/unit/cmd/commands/test_env.py index c6e0e1d20..73cd5af47 100644 --- a/tests/unit/cmd/commands/test_env.py +++ b/tests/unit/cmd/commands/test_env.py @@ -42,7 +42,7 @@ class EnvCommandTestCase(unittest.TestCase): @mock.patch('yardstick.cmd.commands.env.HttpClient.post') def test_start_async_task(self, post_mock): - data = {'action': 'createGrafanaContainer'} + data = {'action': 'create_grafana'} EnvCommand()._start_async_task(data) self.assertTrue(post_mock.called) |