Back to index

python-cliapp  1.20120630
Public Member Functions | Public Attributes
cliapp.hook_tests.FilterHookTests Class Reference

List of all members.

Public Member Functions

def setUp
def callback
def test_returns_argument_if_no_callbacks
def test_calls_callback_and_returns_modified_data
def test_calls_callback_with_extra_args

Public Attributes

 hook
 args
 kwargs

Detailed Description

Definition at line 56 of file hook_tests.py.


Member Function Documentation

def cliapp.hook_tests.FilterHookTests.callback (   self,
  data,
  args,
  kwargs 
)

Definition at line 61 of file hook_tests.py.

00061 
00062     def callback(self, data, *args, **kwargs):
00063         self.args = args
00064         self.kwargs = kwargs
00065         return data + ['callback']

Here is the caller graph for this function:

Definition at line 58 of file hook_tests.py.

00058 
00059     def setUp(self):
00060         self.hook = FilterHook()

Definition at line 69 of file hook_tests.py.

00069 
00070     def test_calls_callback_and_returns_modified_data(self):
00071         self.hook.add_callback(self.callback)
00072         data = self.hook.call_callbacks([])
00073         self.assertEqual(data, ['callback'])

Here is the call graph for this function:

Definition at line 74 of file hook_tests.py.

00074 
00075     def test_calls_callback_with_extra_args(self):
00076         self.hook.add_callback(self.callback)
00077         self.hook.call_callbacks(['data'], 'extra', kwextra='kwextra')
00078         self.assertEqual(self.args, ('extra',))
00079         self.assertEqual(self.kwargs, { 'kwextra': 'kwextra' })
00080 

Here is the call graph for this function:

Definition at line 66 of file hook_tests.py.

00066 
00067     def test_returns_argument_if_no_callbacks(self):
00068         self.assertEqual(self.hook.call_callbacks(['foo']), ['foo'])
        

Member Data Documentation

Definition at line 62 of file hook_tests.py.

Definition at line 59 of file hook_tests.py.

Definition at line 63 of file hook_tests.py.


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