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