Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
PluggableAuthService.plugins.tests.test_ScriptablePlugin.ScriptablePluginTests Class Reference

List of all members.

Public Member Functions

def test_empty
def test_withTwo
def test_withTwoOnlyOneWired
def test_withTwoMinusOne

Private Member Functions

def _getTargetClass
def _makeOne

Detailed Description

Definition at line 43 of file test_ScriptablePlugin.py.


Member Function Documentation

Definition at line 45 of file test_ScriptablePlugin.py.

00045 
00046     def _getTargetClass( self ):
00047 
00048         from Products.PluggableAuthService.plugins.ScriptablePlugin \
00049             import ScriptablePlugin
00050 
00051         return ScriptablePlugin

def PluggableAuthService.plugins.tests.test_ScriptablePlugin.ScriptablePluginTests._makeOne (   self,
  id = 'test',
  args,
  kw 
) [private]

Definition at line 52 of file test_ScriptablePlugin.py.

00052 
00053     def _makeOne( self, id='test', *args, **kw ):
00054 
00055         return self._getTargetClass()( id=id, *args, **kw )

Definition at line 56 of file test_ScriptablePlugin.py.

00056 
00057     def test_empty( self ):
00058 
00059         scriptable_plugin = self._makeOne()
00060         self.failIf( IFaux in providedBy(scriptable_plugin) )
00061         self.failIf( IFauxTwo in providedBy(scriptable_plugin) )

Definition at line 62 of file test_ScriptablePlugin.py.

00062 
00063     def test_withTwo( self ):
00064 
00065         parent = Folder()
00066         parent._setObject( 'plugins', DummyPluginRegistry() )
00067 
00068         scriptable_plugin = self._makeOne().__of__(parent)
00069 
00070         faux_method = SimpleItem( 'faux_method' )
00071         two_method = SimpleItem( 'two_method' )
00072 
00073         scriptable_plugin._setObject( 'faux_method', faux_method )
00074         scriptable_plugin._setObject( 'two_method', two_method )
00075 
00076         scriptable_plugin.manage_updateInterfaces( ['IFaux', 'IFauxTwo'] )
00077 
00078         self.failUnless( IFaux in providedBy(scriptable_plugin) )
00079         self.failUnless( IFauxTwo in providedBy(scriptable_plugin) )

Definition at line 97 of file test_ScriptablePlugin.py.

00097 
00098     def test_withTwoMinusOne( self ):
00099 
00100         parent = Folder()
00101         parent._setObject( 'plugins', DummyPluginRegistry() )
00102 
00103         scriptable_plugin = self._makeOne().__of__(parent)
00104 
00105         faux_method = SimpleItem( 'faux_method' )
00106         two_method = SimpleItem( 'two_method' )
00107 
00108         scriptable_plugin._setObject( 'faux_method', faux_method )
00109         scriptable_plugin._setObject( 'two_method', two_method )
00110 
00111         scriptable_plugin.manage_updateInterfaces( ['IFaux', 'IFauxTwo'] )
00112 
00113         scriptable_plugin._delObject( 'two_method' )
00114 
00115         self.failUnless( IFaux in providedBy(scriptable_plugin) )
00116         self.failIf( IFauxTwo in providedBy(scriptable_plugin) )
00117 

Definition at line 80 of file test_ScriptablePlugin.py.

00080 
00081     def test_withTwoOnlyOneWired( self ):
00082 
00083         parent = Folder()
00084         parent._setObject( 'plugins', DummyPluginRegistry() )
00085 
00086         scriptable_plugin = self._makeOne().__of__(parent)
00087 
00088         faux_method = SimpleItem( 'faux_method' )
00089         whatever = SimpleItem( 'whatever' )
00090 
00091         scriptable_plugin._setObject( 'faux_method', faux_method )
00092         scriptable_plugin._setObject( 'whatever', whatever )
00093 
00094         scriptable_plugin.manage_updateInterfaces( ['IFaux',] )
00095 
00096         self.failUnless( IFaux in providedBy(scriptable_plugin) )


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