Example #1
0
 def test_delete_object(self):
     # delete an object at a key
     obj = self.objs["embedded"]
     get(obj["path"] + "/a1").status(200)
     delete(obj["path"] + "/a1").status(200)
     get(obj["path"] + "/a1").status(404)
     get(obj["path"] + "/a2").status(200)
     # delete an object in an array
     obj = self.objs["complex"]
     _id = obj["response"].body["sections"][0]["_id"]
     _id2 = obj["response"].body["sections"][1]["_id"]
     get(obj["path"] + "/sections/" + _id).status(200)
     delete(obj["path"] + "/sections/" + _id).status(200)
     get(obj["path"] + "/sections/" + _id).status(404)
     get(obj["path"] + "/sections/" + _id2).status(200)
Example #2
0
 def test_delete_object(self):
     # delete an object at a key
     obj = self.objs["embedded"]
     get(obj["path"] + "/a1").status(200)
     delete(obj["path"] + "/a1").status(200)
     get(obj["path"] + "/a1").status(404)
     get(obj["path"] + "/a2").status(200)
     # delete an object in an array
     obj = self.objs["complex"]
     _id = obj["response"].body["sections"][0]["_id"]
     _id2 = obj["response"].body["sections"][1]["_id"]
     get(obj["path"] + "/sections/" + _id).status(200)
     delete(obj["path"] + "/sections/" + _id).status(200)
     get(obj["path"] + "/sections/" + _id).status(404)
     get(obj["path"] + "/sections/" + _id2).status(200)
Example #3
0
 def tearDown(self):
     for obj in self.objs:
         try:
             delete(obj["path"])
         except:
             pass
Example #4
0
 def test_delete_value(self):
     obj = self.objs["simple"]
     get(obj["path"] + "/name").status(200)
     delete(obj["path"] + "/name").status(200)
     get(obj["path"] + "/name").status(404)
     get(obj["path"] + "/nums").status(200)
Example #5
0
 def test_delete_array(self):
     obj = self.objs["complex"]
     get(obj["path"] + "/sections").status(200)
     delete(obj["path"] + "/sections").status(200)
     get(obj["path"] + "/sections").status(404)
Example #6
0
 def test_delete_document(self):
     obj = self.objs["embedded"]
     get(obj["path"]).status(200)
     delete(obj["path"]).status(200)
     get(obj["path"]).status(404)
Example #7
0
 def test_delete_collection(self):
     delete("/test").status(405)
Example #8
0
 def tearDown(self):
     for obj in self.objs:
         try:
             delete(obj["path"])
         except:
             pass
Example #9
0
 def test_delete_value(self):
     obj = self.objs["simple"]
     get(obj["path"] + "/name").status(200)
     delete(obj["path"] + "/name").status(200)
     get(obj["path"] + "/name").status(404)
     get(obj["path"] + "/nums").status(200)
Example #10
0
 def test_delete_array(self):
     obj = self.objs["complex"]
     get(obj["path"] + "/sections").status(200)
     delete(obj["path"] + "/sections").status(200)
     get(obj["path"] + "/sections").status(404)
Example #11
0
 def test_delete_document(self):
     obj = self.objs["embedded"]
     get(obj["path"]).status(200)
     delete(obj["path"]).status(200)
     get(obj["path"]).status(404)
Example #12
0
 def test_delete_collection(self):
     delete("/test").status(405)