Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
GenericSetup.tests.test_utils.MarkerInterfaceHelpersTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test__extractMarkers
def test__purgeMarkers
def test__initMarkers

Public Attributes

 helpers

Private Member Functions

def _getTargetClass
def _makeOne
def _populate

Detailed Description

Definition at line 419 of file test_utils.py.


Member Function Documentation

Definition at line 421 of file test_utils.py.

00421 
00422     def _getTargetClass(self):
00423         from Products.GenericSetup.utils import MarkerInterfaceHelpers
00424 
00425         return MarkerInterfaceHelpers

def GenericSetup.tests.test_utils.MarkerInterfaceHelpersTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 426 of file test_utils.py.

00426 
00427     def _makeOne(self, *args, **kw):
00428         from Products.GenericSetup.utils import NodeAdapterBase
00429 
00430         class Foo(self._getTargetClass(), NodeAdapterBase):
00431 
00432             pass
00433 
00434         return Foo(*args, **kw)

Definition at line 435 of file test_utils.py.

00435 
00436     def _populate(self, obj):
00437         directlyProvides(obj, IDummyMarker)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 438 of file test_utils.py.

00438 
00439     def setUp(self):
00440         obj = Item('obj')
00441         self.helpers = self._makeOne(obj, DummySetupEnviron())
00442         provideAdapter(MarkerInterfacesAdapter, (IItem,))
00443         provideInterface('', IDummyMarker)

Definition at line 444 of file test_utils.py.

00444 
00445     def tearDown(self):
00446         cleanUp()

Here is the call graph for this function:

Definition at line 447 of file test_utils.py.

00447 
00448     def test__extractMarkers(self):
00449         self._populate(self.helpers.context)
00450         doc = self.helpers._doc = PrettyDocument()
00451         node = doc.createElement('dummy')
00452         node.appendChild(self.helpers._extractMarkers())
00453         doc.appendChild(node)
00454 
00455         self.assertEqual(doc.toprettyxml(' '), _NORMAL_MARKER_EXPORT)

Here is the call graph for this function:

Definition at line 464 of file test_utils.py.

00464 
00465     def test__initMarkers(self):
00466         node = parseString(_NORMAL_MARKER_EXPORT).documentElement
00467         self.helpers._initMarkers(node)
00468         self.failUnless(IDummyMarker.providedBy(self.helpers.context))
00469 
00470         doc = self.helpers._doc = PrettyDocument()
00471         node = doc.createElement('dummy')
00472         node.appendChild(self.helpers._extractMarkers())
00473         doc.appendChild(node)
00474 
00475         self.assertEqual(doc.toprettyxml(' '), _NORMAL_MARKER_EXPORT)
00476 

Definition at line 456 of file test_utils.py.

00456 
00457     def test__purgeMarkers(self):
00458         obj = self.helpers.context
00459         self._populate(obj)
00460         self.failUnless(IDummyMarker.providedBy(obj))
00461 
00462         self.helpers._purgeMarkers()
00463         self.failIf(IDummyMarker.providedBy(obj))

Here is the call graph for this function:


Member Data Documentation

Definition at line 440 of file test_utils.py.


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