def testRequestPassedToChecker(self): checker = DummyChecker() wrapped = protect(checker)(funcWithRequest) request = [] wrapped("one", "two", request) self.failUnless(checker.request is request)
def testMixedArguments(self): wrapped = protect()(funcWithRequest) self.assertEqual(wrapped("one", two="two"), ("one", "two"))
def testFunctionMustHaveRequest(self): protector = protect() self.assertRaises(ValueError, protector, funcWithoutRequest)