From db36e98243a4cb1c12d2245b8469743168d00f06 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 3 Jan 2018 10:33:08 +0800 Subject: add deployment result collecting interfaces Change-Id: I5fe50c44e7b36ea45dd1b8632130b30dfe173d0a Signed-off-by: SerenaFeng --- testapi/opnfv_testapi/tests/unit/handlers/test_base.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'testapi/opnfv_testapi/tests/unit/handlers/test_base.py') diff --git a/testapi/opnfv_testapi/tests/unit/handlers/test_base.py b/testapi/opnfv_testapi/tests/unit/handlers/test_base.py index 4e5c0d9..c98ed69 100644 --- a/testapi/opnfv_testapi/tests/unit/handlers/test_base.py +++ b/testapi/opnfv_testapi/tests/unit/handlers/test_base.py @@ -81,6 +81,16 @@ class TestBase(testing.AsyncHTTPTestCase): self.config_patcher.start() self.db_patcher.start() + @staticmethod + def load_json(json_file): + abs_file = path.join(path.dirname(__file__), + '../templates', + json_file + '.json') + with open(abs_file, 'r') as f: + loader = json.load(f) + f.close() + return loader + def get_app(self): from opnfv_testapi.cmd import server return server.make_app() @@ -210,4 +220,5 @@ class TestBase(testing.AsyncHTTPTestCase): fake_pymongo.projects.clear() fake_pymongo.testcases.clear() fake_pymongo.results.clear() + fake_pymongo.deployresults.clear() fake_pymongo.scenarios.clear() -- cgit 1.2.3-korg