def test_delete(self):
     delete_request = getData('delete_request.txt')
     delete_response = getData('delete_response.txt')
     c = SolrConnection(host='localhost:8983', persistent=True)
     output = fakehttp(c, delete_response)
     c.delete('500')
     res = c.flush()
     self.assertEqual(len(res), 1)   # one request was sent
     res = res[0]
     self.failUnlessEqual(str(output), delete_request)
     # Status
     node = res.findall(".//int")[0]
     self.failUnlessEqual(node.attrib['name'], 'status')
     self.failUnlessEqual(node.text, '0')
     # QTime
     node = res.findall(".//int")[1]
     self.failUnlessEqual(node.attrib['name'], 'QTime')
     self.failUnlessEqual(node.text, '0')
     res.find('QTime')
Esempio n. 2
0
 def test_delete(self):
     delete_request = getData('delete_request.txt')
     delete_response = getData('delete_response.txt')
     c = SolrConnection(host='localhost:8983', persistent=True)
     output = fakehttp(c, delete_response)
     c.delete('500')
     res = c.flush()
     self.assertEqual(len(res), 1)   # one request was sent
     res = res[0]
     self.failUnlessEqual(str(output), delete_request)
     # Status
     node = res.findall(".//int")[0]
     self.failUnlessEqual(node.attrib['name'], 'status')
     self.failUnlessEqual(node.text, '0')
     # QTime
     node = res.findall(".//int")[1]
     self.failUnlessEqual(node.attrib['name'], 'QTime')
     self.failUnlessEqual(node.text, '0')
     res.find('QTime')
Esempio n. 3
0
 def test_delete(self):
     delete_request = getData("delete_request.txt").rstrip(b"\n")
     delete_response = getData("delete_response.txt")
     c = SolrConnection(host="localhost:8983", persistent=True)
     output = fakehttp(c, delete_response)
     c.delete("500")
     res = c.flush()
     self.assertEqual(len(res), 1)  # one request was sent
     res = res[0]
     self.failUnlessEqual(str(output), delete_request.decode("utf-8"))
     # Status
     node = res.findall(".//int")[0]
     self.failUnlessEqual(node.attrib["name"], "status")
     self.failUnlessEqual(node.text, "0")
     # QTime
     node = res.findall(".//int")[1]
     self.failUnlessEqual(node.attrib["name"], "QTime")
     self.failUnlessEqual(node.text, "0")
     res.find("QTime")