summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/tests
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/tests')
-rw-r--r--utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py3
-rw-r--r--utils/test/testapi/opnfv_testapi/tests/unit/resources/test_base.py8
2 files changed, 4 insertions, 7 deletions
diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py b/utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py
index d95ff372e..0ca83df62 100644
--- a/utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py
+++ b/utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py
@@ -6,9 +6,10 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+from operator import itemgetter
+
from bson.objectid import ObjectId
from concurrent.futures import ThreadPoolExecutor
-from operator import itemgetter
def thread_execute(method, *args, **kwargs):
diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_base.py b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_base.py
index 67831f508..dcec4e958 100644
--- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_base.py
+++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_base.py
@@ -41,18 +41,14 @@ class TestBase(testing.AsyncHTTPTestCase):
self.config_patcher = mock.patch(
'argparse.ArgumentParser.parse_known_args',
return_value=(argparse.Namespace(config_file=config), None))
- self.db_patcher = mock.patch('opnfv_testapi.cmd.server.get_db',
- self._fake_pymongo)
+ self.db_patcher = mock.patch('opnfv_testapi.db.api.DB',
+ fake_pymongo)
self.config_patcher.start()
self.db_patcher.start()
def set_config_file(self):
self.config_file = 'normal.ini'
- @staticmethod
- def _fake_pymongo():
- return fake_pymongo
-
def get_app(self):
from opnfv_testapi.cmd import server
return server.make_app()