def test_NoSpecialHeaders(self): server = Session("www.example.com") request = Delete(server, "/") hdrs = request.generateRequestHeader() self.assertFalse("If-None-Match:" in hdrs) self.assertFalse("If-Match:" in hdrs)
def test_IfMatchHeader(self): server = Session("www.example.com") request = Delete(server, "/") request.setData(etag="\"12345\"") hdrs = request.generateRequestHeader() self.assertFalse("If-None-Match:" in hdrs) self.assertTrue("If-Match: \"12345\"" in hdrs)
def deleteResource(self, rurl): assert(isinstance(rurl, URL)) # Create WebDAV DELETE request = Delete(self, rurl.relativeURL()) # Process it self.runSession(request) if request.getStatusCode() not in (statuscodes.OK, statuscodes.NoContent): self.handleHTTPError(request)
def deleteResource(self, rurl): assert (isinstance(rurl, URL)) # Create WebDAV DELETE request = Delete(self, rurl.relativeURL()) # Process it self.runSession(request) if request.getStatusCode() not in (statuscodes.OK, statuscodes.NoContent): self.handleHTTPError(request)
def test_Method(self): server = Session("www.example.com") request = Delete(server, "/") self.assertEqual(request.getMethod(), "DELETE")