summaryrefslogtreecommitdiffstats
path: root/tests/qtip_server_test.py
diff options
context:
space:
mode:
authorzhifeng.jiang <jiang.zhifeng@zte.com.cn>2016-09-30 00:43:40 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-09-30 00:43:40 +0000
commitb64891aa2fa0ef7db659831217328f3ce9e9fab4 (patch)
treea2ee42833673eec5f8b4d040e67e9700f714f2d3 /tests/qtip_server_test.py
parent5f07d28f5a90f7e19d0eddcbe04509e4246440fa (diff)
parent0d3fb3fb9aee914b425f3f8ed9c843d6052f7ada (diff)
Merge "Start restful server auto in docker"
Diffstat (limited to 'tests/qtip_server_test.py')
-rw-r--r--tests/qtip_server_test.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/qtip_server_test.py b/tests/qtip_server_test.py
index 3f70a1f6..511d209a 100644
--- a/tests/qtip_server_test.py
+++ b/tests/qtip_server_test.py
@@ -41,7 +41,7 @@ class TestClass:
{'state': 'finished', 'benchmark': 'ramspeed_bm.yaml'},
{'state': 'finished', 'benchmark': 'dpi_bm.yaml'},
{'state': 'finished', 'benchmark': 'ssl_bm.yaml'}],
- 'result': []}),
+ 'result': 0}),
({'installer_type': 'fuel',
'installer_ip': '10.20.0.2',
'pod_name': 'zte-pod1',
@@ -61,10 +61,27 @@ class TestClass:
{u'state': u'finished', u'benchmark': u'ramspeed_vm.yaml'},
{u'state': u'finished', u'benchmark': u'dpi_vm.yaml'},
{u'state': u'finished', u'benchmark': u'ssl_vm.yaml'}],
- 'result': []})
+ 'result': 0})
])
@mock.patch('restful_server.qtip_server.args_handler.prepare_and_run_benchmark')
def test_post_get_delete_job_successful(self, mock_args_handler, app_client, body, expected):
+ mock_args_handler.return_value = {'result': 0,
+ 'detail': {'host': [(u'10.20.6.14', {'unreachable': 0,
+ 'skipped': 13,
+ 'ok': 27,
+ 'changed': 26,
+ 'failures': 0}),
+ ('localhost', {'unreachable': 0,
+ 'skipped': 0,
+ 'ok': 6,
+ 'changed': 6,
+ 'failures': 0}),
+ (u'10.20.6.13', {'unreachable': 0,
+ 'skipped': 13,
+ 'ok': 27,
+ 'changed': 26,
+ 'failures': 0})]}}
+
reply = app_client.post("/api/v1.0/jobs", data=body)
print(reply.data)
id = json.loads(reply.data)['job_id']