From 73edf3d28e7d17a64ddc9ffea206ec825c488bc6 Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Tue, 22 Nov 2016 00:14:57 +0000 Subject: Create API to get test case result JIRA: YARDSTICK-416 Change-Id: I722566bb0e5bc5288cd6302559e56a3f92ebbeca Signed-off-by: chenjiankun --- tests/unit/api/actions/test_result.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/unit/api/actions/test_result.py (limited to 'tests/unit/api/actions/test_result.py') diff --git a/tests/unit/api/actions/test_result.py b/tests/unit/api/actions/test_result.py new file mode 100644 index 000000000..168631905 --- /dev/null +++ b/tests/unit/api/actions/test_result.py @@ -0,0 +1,29 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import unittest +import json + +from api.actions import result + + +class GetResultTestCase(unittest.TestCase): + + def test_getResult_with_no_taskid_arg(self): + args = {} + output = json.loads(result.getResult(args)) + + self.assertEqual('error', output['status']) + + +def main(): + unittest.main() + + +if __name__ == '__main__': + main() -- cgit 1.2.3-korg