def test_OverwriteHeader(self): server = Session("www.example.com") request = Move(server, "/a", "http://www.example.com/b", overwrite=True) hdrs = request.generateRequestHeader() self.assertFalse("If-None-Match:" in hdrs) self.assertFalse("If-Match:" in hdrs) self.assertTrue("Overwrite: T" in hdrs) self.assertTrue("Destination: http://www.example.com/b" in hdrs)
def test_NoSpecialHeaders(self): server = Session("www.example.com") request = Move(server, "/a", "http://www.example.com/b") hdrs = request.generateRequestHeader() self.assertFalse("If-None-Match:" in hdrs) self.assertFalse("If-Match:" in hdrs) self.assertTrue("Overwrite: F" in hdrs) self.assertTrue("Destination: http://www.example.com/b" in hdrs)
def test_IfMatchHeader(self): server = Session("www.example.com") request = Move(server, "/a", "http://www.example.com/b") request.setData(etag="\"12345\"") hdrs = request.generateRequestHeader() self.assertFalse("If-None-Match:" in hdrs) self.assertTrue("If-Match: \"12345\"" in hdrs) self.assertTrue("Overwrite: F" in hdrs) self.assertTrue("Destination: http://www.example.com/b" in hdrs)