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 | 72de1829c79a377e0ae1d69f0ebf6af495c06b08 (patch) | |
tree | 3b9914ed6ac1ef36092b264148a5db3e01e309f1 /utils/test/result_collection_api/opnfv_testapi/tests/unit/test_testcase.py | |
parent | 09d46e12cd5983bcde49bd77499e1175e5ed118a (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 'utils/test/result_collection_api/opnfv_testapi/tests/unit/test_testcase.py')
-rw-r--r-- | utils/test/result_collection_api/opnfv_testapi/tests/unit/test_testcase.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_testcase.py b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_testcase.py index a145c00da..cb767844a 100644 --- a/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_testcase.py +++ b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_testcase.py @@ -7,6 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## import unittest +import copy from test_base import TestBase from opnfv_testapi.resources.testcase_models import TestcaseCreateRequest, \ @@ -168,6 +169,13 @@ class TestCaseUpdate(TestCaseBase): self.assertEqual(_id, new_body._id) self.assert_update_body(self.req_d, new_body, self.update_e) + def test_with_dollar(self): + self.create_d() + update = copy.deepcopy(self.update_d) + update.description = {'2. change': 'dollar change'} + code, body = self.update(update, self.req_d.name) + self.assertEqual(code, HTTP_OK) + class TestCaseDelete(TestCaseBase): def test_notFound(self): |