Beispiel #1
0
 def test_put_array_onto_collection(self):
     put(collection_path, [1, 2, 3]).status(405)
     put(collection_path, [{
         "hello": "world"
     }, {
         "_id": self.objs["simple"]['id']
     }]).status(405)
Beispiel #2
0
 def test_put_object_onto_object(self):
     obj = self.objs["embedded"]
     put(obj["path"] + "/a2", {"a2b1": {"a2b1c2": 17, "newkey": "hoi!"}}).status(200)
     # ensure that the value itself was updated
     get(obj["path"] + "/a2/a2b1/a2b1c2").status(200).equals(17)
     # ensure that the new field was added
     get(obj["path"] + "/a2/a2b1/newkey").status(200).equals("hoi!")
     # ensure that it was a merge, not an overwrite
     get(obj["path"] + "/a2/a2b2").status(200).equals(obj["data"]["a2"]["a2b2"])
     # ensure that the merge was recursive
     get(obj["path"] + "/a2/a2b1/a2b1c1").status(200).equals(obj["data"]["a2"]["a2b1"]["a2b1c1"])
Beispiel #3
0
 def test_put_object_onto_document(self):
     obj = self.objs["complex"]
     put(obj["path"], {"d": {"here": "?"}, "_id": dummy_id}).status(200)
     # check that the id didn't change
     get(obj["path"]).status(200).attrval("_id", obj["response"].body["_id"])
     # ensure that the value itself was set
     get(obj["path"] + "/d/here").status(200).equals("?")
     # ensure that it was a merge, not an overwrite
     get(obj["path"] + "/type").status(200).equals(obj["data"]["type"])
     # ensure that the merge was recursive
     get(obj["path"] + "/d/more").status(200).equals(obj["data"]["d"]["more"])
Beispiel #4
0
 def test_put_object_onto_document(self):
     obj = self.objs["complex"]
     put(obj["path"], {"d": {"here": "?"}, "_id": dummy_id}).status(200)
     # check that the id didn't change
     get(obj["path"]).status(200).attrval("_id",
                                          obj["response"].body["_id"])
     # ensure that the value itself was set
     get(obj["path"] + "/d/here").status(200).equals("?")
     # ensure that it was a merge, not an overwrite
     get(obj["path"] + "/type").status(200).equals(obj["data"]["type"])
     # ensure that the merge was recursive
     get(obj["path"] + "/d/more").status(200).equals(
         obj["data"]["d"]["more"])
Beispiel #5
0
 def test_put_object_onto_object(self):
     obj = self.objs["embedded"]
     put(obj["path"] + "/a2", {
         "a2b1": {
             "a2b1c2": 17,
             "newkey": "hoi!"
         }
     }).status(200)
     # ensure that the value itself was updated
     get(obj["path"] + "/a2/a2b1/a2b1c2").status(200).equals(17)
     # ensure that the new field was added
     get(obj["path"] + "/a2/a2b1/newkey").status(200).equals("hoi!")
     # ensure that it was a merge, not an overwrite
     get(obj["path"] + "/a2/a2b2").status(200).equals(
         obj["data"]["a2"]["a2b2"])
     # ensure that the merge was recursive
     get(obj["path"] + "/a2/a2b1/a2b1c1").status(200).equals(
         obj["data"]["a2"]["a2b1"]["a2b1c1"])
Beispiel #6
0
 def test_put_value_onto_collection(self):
     put(collection_path, "hello world").status(405)
     put(collection_path, 17).status(405)
Beispiel #7
0
 def test_put_array_onto_collection(self):
     put(collection_path, [1, 2, 3]).status(405)
     put(collection_path, [{"hello": "world"}, {"_id": self.objs["simple"]["id"]}]).status(405)
Beispiel #8
0
 def test_put_object_onto_collection(self):
     put(collection_path, {"hello": "world"}).status(405)
     put(collection_path, {"hello": "world", "_id": self.objs["simple"]["id"]}).status(405)
Beispiel #9
0
 def test_put_value_onto_collection(self):
     put(collection_path, "hello world").status(405)
     put(collection_path, 17).status(405)
Beispiel #10
0
 def test_put_object_onto_collection(self):
     put(collection_path, {"hello": "world"}).status(405)
     put(collection_path, {
         "hello": "world",
         "_id": self.objs["simple"]['id']
     }).status(405)