From 95c48ad7ad59486c609c3285c457d0352884e3d7 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 15 Jun 2016 09:49:35 +0800 Subject: 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 --- result_collection_api/opnfv_testapi/tests/unit/test_result.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'result_collection_api/opnfv_testapi/tests/unit/test_result.py') 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): -- cgit 1.2.3-korg