support keys start with '$' or contain '.' in testAPI
[releng.git] / utils / test / result_collection_api / opnfv_testapi / tests / unit / test_result.py
index dbc4431..bba3b22 100644 (file)
@@ -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):