summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/tests/unit/handlers/test_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/opnfv_testapi/tests/unit/handlers/test_base.py')
-rw-r--r--testapi/opnfv_testapi/tests/unit/handlers/test_base.py11
1 files changed, 11 insertions, 0 deletions
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()