diff options
author | Jing Lu <lvjing5@huawei.com> | 2016-12-01 00:52:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-12-01 00:52:54 +0000 |
commit | f62146fc98322caa63c658b17589cfff280471fb (patch) | |
tree | 4046e9539acc8efc3d442fb7033b2667137d05c9 /tests/unit/api/utils/test_common.py | |
parent | 462f25c8e950110a1624909d4f79ef4219005ba2 (diff) | |
parent | 1558bcf48bdba369187d7cb07482f2fbcc6f4feb (diff) |
Merge "Use flask jsonify method to return json result"
Diffstat (limited to 'tests/unit/api/utils/test_common.py')
-rw-r--r-- | tests/unit/api/utils/test_common.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/unit/api/utils/test_common.py b/tests/unit/api/utils/test_common.py index 9e050c714..5d177409e 100644 --- a/tests/unit/api/utils/test_common.py +++ b/tests/unit/api/utils/test_common.py @@ -7,7 +7,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## import unittest -import json from api.utils import common @@ -58,35 +57,6 @@ class GetCommandListTestCase(unittest.TestCase): self.assertEqual(result_list, output_list) -class ErrorHandlerTestCase(unittest.TestCase): - - def test_error_handler(self): - message = 'hello world' - output_dict = json.loads(common.error_handler(message)) - - result = { - 'status': 'error', - 'message': message - } - - self.assertEqual(result, output_dict) - - -class ResultHandlerTestCase(unittest.TestCase): - - def test_result_handler(self): - status = 1 - data = ['hello world'] - output_dict = json.loads(common.result_handler(status, data)) - - result = { - 'status': status, - 'result': data - } - - self.assertEqual(result, output_dict) - - def main(): unittest.main() |