Back to index

plone3  3.1.7
Public Member Functions
plone.protect.tests.testUtils.DecoratorTests Class Reference
Inheritance diagram for plone.protect.tests.testUtils.DecoratorTests:
Inheritance graph
[legend]
Collaboration diagram for plone.protect.tests.testUtils.DecoratorTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testFunctionMustHaveRequest
def testArgumentsPassed
def testKeywordArguments
def testMixedArguments
def testRequestPassedToChecker

Detailed Description

Definition at line 16 of file testUtils.py.


Member Function Documentation

Definition at line 21 of file testUtils.py.

00021 
00022     def testArgumentsPassed(self):
00023         wrapped=protect()(funcWithRequest)
00024         self.assertEqual(wrapped("one", "two"), ("one", "two"))

Definition at line 17 of file testUtils.py.

00017 
00018     def testFunctionMustHaveRequest(self):
00019         protector=protect()
00020         self.assertRaises(ValueError, protector, funcWithoutRequest)

Definition at line 25 of file testUtils.py.

00025 
00026     def testKeywordArguments(self):
00027         wrapped=protect()(funcWithRequest)
00028         self.assertEqual(wrapped(one="one", two="two"), ("one", "two"))

Definition at line 29 of file testUtils.py.

00029 
00030     def testMixedArguments(self):
00031         wrapped=protect()(funcWithRequest)
00032         self.assertEqual(wrapped("one", two="two"), ("one", "two"))

Definition at line 33 of file testUtils.py.

00033 
00034     def testRequestPassedToChecker(self):
00035         checker=DummyChecker()
00036         wrapped=protect(checker)(funcWithRequest)
00037         request=[]
00038         wrapped("one", "two", request)
00039         self.failUnless(checker.request is request)
00040 
00041 


The documentation for this class was generated from the following file: