def test_IfNoneMatchHeader(self): server = Session("www.example.com") request = Lock(server, "/", headers.Depth0, Lock.eExclusive, "*****@*****.**", -1, exists=Lock.eResourceMustNotExist) hdrs = request.generateRequestHeader() self.assertTrue("If-None-Match: *" in hdrs) self.assertFalse("If-Match:" in hdrs)
def test_DepthInfinityHeaders(self): server = Session("www.example.com") request = Lock(server, "/", headers.DepthInfinity, Lock.eExclusive, "*****@*****.**", -1, exists=Lock.eResourceMustNotExist) hdrs = request.generateRequestHeader() self.assertFalse("Depth: 0" in hdrs) self.assertFalse("Depth: 1" in hdrs) self.assertTrue("Depth: infinity" in hdrs)
def test_Depth1Headers(self): server = Session("www.example.com") request = Lock(server, "/", headers.Depth1, Lock.eExclusive, "*****@*****.**", -1, exists=Lock.eResourceMustNotExist) hdrs = request.generateRequestHeader() self.assertFalse("Depth: 0" in hdrs) self.assertTrue("Depth: 1" in hdrs) self.assertFalse("Depth: infinity" in hdrs)