diff options
author | 2017-07-14 19:27:44 +0800 | |
---|---|---|
committer | 2017-07-21 13:34:38 +0000 | |
commit | 822cd5c32c9a129aa8aad9952f25a37123c96733 (patch) | |
tree | 6f4edb8aa5d130a7812b15c70f1186f0138fc560 /utils/test/testapi/opnfv_testapi/tests/unit/resources/test_base.py | |
parent | cbcabf6643e68c019b407c95b1526e77337f7697 (diff) |
separate db methods from handler.py
db methods are mingled in handler, which is not well structured
Change-Id: I639679d3fc05a0b6528158186b8bf89e0cd10596
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/tests/unit/resources/test_base.py')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tests/unit/resources/test_base.py | 8 |
1 files changed, 2 insertions, 6 deletions
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() |