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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 5
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)
Ejemplo n.º 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")
Ejemplo n.º 8
0
    def test_Method(self):

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