diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-06-15 09:49:35 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-06-15 16:05:37 +0800 |
commit | 95c48ad7ad59486c609c3285c457d0352884e3d7 (patch) | |
tree | 2153ff64815a175dd342ad2c713fe4243ea8384a /result_collection_api/opnfv_testapi/tests/unit/test_result.py | |
parent | 9b418c0af7968c16cc661448bf7b4b7d5e116ee4 (diff) |
support keys start with '$' or contain '.' in testAPI
set check_keys=False in insert and update db
fix update and insert stub in fake_pymongo.py
add unittest for check_keys in test_fake_pymongo.py
JIRA: FUNCTEST-313
Change-Id: I4051ec4a1c70996c87167643f6ea19993f5b0811
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'result_collection_api/opnfv_testapi/tests/unit/test_result.py')
-rw-r--r-- | result_collection_api/opnfv_testapi/tests/unit/test_result.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/result_collection_api/opnfv_testapi/tests/unit/test_result.py b/result_collection_api/opnfv_testapi/tests/unit/test_result.py index dbc4431..bba3b22 100644 --- a/result_collection_api/opnfv_testapi/tests/unit/test_result.py +++ b/result_collection_api/opnfv_testapi/tests/unit/test_result.py @@ -7,6 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## import unittest +import copy from opnfv_testapi.common.constants import HTTP_OK, HTTP_BAD_REQUEST, \ HTTP_NOT_FOUND @@ -161,6 +162,13 @@ class TestResultCreate(TestResultBase): self.assertEqual(code, HTTP_OK) self.assert_href(body) + def test_key_with_doc(self): + req = copy.deepcopy(self.req_d) + req.details = {'1.name': 'dot_name'} + (code, body) = self.create(req) + self.assertEqual(code, HTTP_OK) + self.assert_href(body) + class TestResultGet(TestResultBase): def test_getOne(self): |