Exemple #1
0
 def testRequestPassedToChecker(self):
     checker = DummyChecker()
     wrapped = protect(checker)(funcWithRequest)
     request = []
     wrapped("one", "two", request)
     self.failUnless(checker.request is request)
Exemple #2
0
 def testMixedArguments(self):
     wrapped = protect()(funcWithRequest)
     self.assertEqual(wrapped("one", two="two"), ("one", "two"))
Exemple #3
0
 def testFunctionMustHaveRequest(self):
     protector = protect()
     self.assertRaises(ValueError, protector, funcWithoutRequest)
Exemple #4
0
 def testRequestPassedToChecker(self):
     checker = DummyChecker()
     wrapped = protect(checker)(funcWithRequest)
     request = []
     wrapped("one", "two", request)
     self.failUnless(checker.request is request)
Exemple #5
0
 def testMixedArguments(self):
     wrapped = protect()(funcWithRequest)
     self.assertEqual(wrapped("one", two="two"), ("one", "two"))
Exemple #6
0
 def testFunctionMustHaveRequest(self):
     protector = protect()
     self.assertRaises(ValueError, protector, funcWithoutRequest)