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)
示例#2
0
    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)
示例#4
0
    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)
示例#6
0
    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")
示例#8
0
    def test_Method(self):

        server = Session("www.example.com")
        request = Delete(server, "/")
        self.assertEqual(request.getMethod(), "DELETE")