Exemplo n.º 1
0
 def testPolicy_withoutPaths(self):
     withPaths = Policy([PolicyTest.sampleDirective3, PolicyTest.sampleDirective5, PolicyTest.sampleDirective7])
     withoutPaths = Policy([PolicyTest.sampleDirective3, PolicyTest.sampleDirective5.withoutPaths(), 
                            PolicyTest.sampleDirective7])
     assert withPaths.withoutPaths() == withoutPaths
     assert withoutPaths.withoutPaths() == withoutPaths
     assert Policy.INVALID().withoutPaths() == Policy.INVALID()
Exemplo n.º 2
0
 def testPolicy_withoutPaths(self):
     withPaths = Policy([
         PolicyTest.sampleDirective3, PolicyTest.sampleDirective5,
         PolicyTest.sampleDirective7
     ])
     withoutPaths = Policy([
         PolicyTest.sampleDirective3,
         PolicyTest.sampleDirective5.withoutPaths(),
         PolicyTest.sampleDirective7
     ])
     assert withPaths.withoutPaths() == withoutPaths
     assert withoutPaths.withoutPaths() == withoutPaths
     assert Policy.INVALID().withoutPaths() == Policy.INVALID()
Exemplo n.º 3
0
 def testPolicy_withoutPaths_schemeOnly(self):
     withPaths = Policy(
         [PolicyTest.sampleDirective3, PolicyTest.sampleDirective5])
     withoutPaths = Policy([
         PolicyTest.sampleDirective3,
         PolicyTest.sampleDirective5.withoutPaths(["http"])
     ])
     assert withPaths.withoutPaths(["http"]) == withoutPaths
Exemplo n.º 4
0
 def testPolicy_withoutPaths_schemeOnly(self):
     withPaths = Policy([PolicyTest.sampleDirective3, PolicyTest.sampleDirective5])
     withoutPaths = Policy([PolicyTest.sampleDirective3, PolicyTest.sampleDirective5.withoutPaths(["http"])])
     assert withPaths.withoutPaths(["http"]) == withoutPaths