Esempio 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()
Esempio 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()
Esempio 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
Esempio 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