Author: jmorliaguet
Date: Sun Dec 11 00:15:03 2005
New Revision: 2009

Modified:
   cpsskins/branches/jmo-perspectives/doc/portlet-ordering.txt
   cpsskins/branches/jmo-perspectives/elements/theme.py
   cpsskins/branches/jmo-perspectives/ftests/__init__.py
   cpsskins/branches/jmo-perspectives/ftests/test_permissions.py
   cpsskins/branches/jmo-perspectives/tests/setup.py
   cpsskins/branches/jmo-perspectives/tests/test_filters.py
   cpsskins/branches/jmo-perspectives/tests/test_perspective.py
   cpsskins/branches/jmo-perspectives/tests/test_portlet.py
Log:

- test fixes (some more test setup is still needed)



Modified: cpsskins/branches/jmo-perspectives/doc/portlet-ordering.txt
==============================================================================
--- cpsskins/branches/jmo-perspectives/doc/portlet-ordering.txt (original)
+++ cpsskins/branches/jmo-perspectives/doc/portlet-ordering.txt Sun Dec 11 
00:15:03 2005
@@ -6,7 +6,7 @@
 
 We set up some test environment:
 
-    >>> from cpsskins.ftests import addThemeManager, addThemeSkeleton
+    >>> from cpsskins.tests.setup import addThemeManager, addThemeSkeleton
     >>> root = getRootFolder()
     >>> tmutil = addThemeManager(root)
 
@@ -24,7 +24,7 @@
 The slots A and B have their own display
 
     >>> from cpsskins.elements.interfaces import IDisplayable
-    >>> from cpsskins.elements.displays.boxgroup import BoxGroup
+    >>> from cpsskins.engines.default.displays.boxgroup import BoxGroup
 
     >>> display_slot_A = IDisplayable(slot_A).getDisplay()
     >>> display_slot_B = IDisplayable(slot_B).getDisplay()

Modified: cpsskins/branches/jmo-perspectives/elements/theme.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/elements/theme.py        (original)
+++ cpsskins/branches/jmo-perspectives/elements/theme.py        Sun Dec 11 
00:15:03 2005
@@ -52,15 +52,6 @@
 
     def getPages(self):
         """Return the list of pages
-
-        >>> from cpsskins.elements.themepage import ThemePage
-        >>> page = ThemePage()
-        >>> theme = Theme()
-        >>> theme.getPages() == []
-        True
-        >>> theme['page1'] = page
-        >>> theme.getPages() == [page]
-        True
         """
         return [v for v in self.values() if IThemePage.providedBy(v)]
 

Modified: cpsskins/branches/jmo-perspectives/ftests/__init__.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ftests/__init__.py       (original)
+++ cpsskins/branches/jmo-perspectives/ftests/__init__.py       Sun Dec 11 
00:15:03 2005
@@ -17,23 +17,3 @@
 """
 __docformat__ = "reStructuredText"
 
-from zope.app.testing import ztapi
-
-from cpsskins.thememanager import ThemeManagement
-from cpsskins.interfaces import IThemeManagement
-from cpsskins.elements.theme import Theme
-from cpsskins.elements.themepage import ThemePage
-from cpsskins.elements.pageblock import PageBlock
-from cpsskins.elements.cell import Cell
-
-def addThemeManager(root):
-    tmutil = root[u'themes'] = ThemeManagement()
-    ztapi.provideUtility(IThemeManagement, tmutil, name=u'themes')
-    return tmutil
-
-def addThemeSkeleton(tmutil):
-    tmutil[u'theme'] = Theme()
-    tmutil[u'theme'][u'page'] = ThemePage()
-    tmutil[u'theme'][u'page'][u'block'] = PageBlock()
-    tmutil[u'theme'][u'page'][u'block'][u'cell'] = Cell()
-    return tmutil[u'theme']

Modified: cpsskins/branches/jmo-perspectives/ftests/test_permissions.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ftests/test_permissions.py       
(original)
+++ cpsskins/branches/jmo-perspectives/ftests/test_permissions.py       Sun Dec 
11 00:15:03 2005
@@ -21,7 +21,7 @@
 
 from zope.app.testing.functional import BrowserTestCase
 
-from cpsskins.ftests import addThemeManager, addThemeSkeleton
+from cpsskins.tests.setup import addThemeManager, addThemeSkeleton
 
 class Tests(BrowserTestCase):
 

Modified: cpsskins/branches/jmo-perspectives/tests/setup.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/tests/setup.py   (original)
+++ cpsskins/branches/jmo-perspectives/tests/setup.py   Sun Dec 11 00:15:03 2005
@@ -17,27 +17,32 @@
 """
 __docformat__ = "reStructuredText"
 
-def setUp(test):
-    from zope.app.testing import ztapi, setup
-    from zope.app.traversing.interfaces import IPathAdapter
-
-    from cpsskins.elements import element
-    from cpsskins.elements.display import Displayable
-    from cpsskins.elements.format import Formattable
-    from cpsskins.elements.interfaces import IElement, IDisplay
-    from cpsskins.elements.interfaces import IIdentifiable
-    from cpsskins.perspectives import perspective
-    from cpsskins.perspectives.interfaces import IPerspective
-    from cpsskins.relations.interfaces import IRelationTool, IRelationStorage
-    from cpsskins.relations.interfaces import IRelatable
-    from cpsskins.relations.tool import RelationTool
-    from cpsskins.relations.storage import RelationStorage
+from zope.app.testing import ztapi, setup
+from zope.app.traversing.interfaces import IPathAdapter
+from zope.app.event.interfaces import IObjectCreatedEvent, IObjectModifiedEvent
+from zope.app.container.interfaces import IObjectAddedEvent, 
IObjectRemovedEvent
+
+from cpsskins.thememanager import ThemeManagement
+from cpsskins import controllers
+from cpsskins import elements
+from cpsskins.elements.display import Displayable
+from cpsskins.elements.format import Formattable
+from cpsskins.elements.interfaces import IElement, IDisplay
+from cpsskins.elements.interfaces import IIdentifiable
+from cpsskins.perspectives import perspective
+from cpsskins.perspectives.interfaces import IPerspective
+from cpsskins.relations.interfaces import IRelationTool, IRelationStorage
+from cpsskins.relations.interfaces import IRelatable
+from cpsskins.relations.tool import RelationTool
+from cpsskins.relations.storage import RelationStorage
+from cpsskins.interfaces import IThemeManagement
 
+def setUp(test):
     ztapi.provideAdapter(IDisplay, IPathAdapter, Formattable, 'formattable')
     ztapi.provideAdapter(IElement, IPathAdapter, Displayable, 'displayable')
     ztapi.provideAdapter(IElement, IRelationTool, RelationTool)
-    ztapi.provideAdapter(IElement, IIdentifiable, element.Identifiable)
-    ztapi.provideAdapter(IElement, IRelatable, element.Relatable)
+    ztapi.provideAdapter(IElement, IIdentifiable, 
elements.element.Identifiable)
+    ztapi.provideAdapter(IElement, IRelatable, elements.element.Relatable)
     ztapi.provideAdapter(IPerspective, IRelatable, perspective.Relatable)
 
     ztapi.provideAdapter(None, IRelationStorage, RelationStorage)
@@ -45,3 +50,26 @@
 
     setup.setUpSiteManagerLookup()
 
+    # events
+    ztapi.subscribe([IElement, IObjectCreatedEvent], None,
+                    controllers.elementCreated)
+    ztapi.subscribe([IElement, IObjectAddedEvent], None,
+                    controllers.elementAdded)
+    ztapi.subscribe([IElement, IObjectRemovedEvent], None,
+                    controllers.elementRemoved)
+    ztapi.subscribe([IElement, IObjectModifiedEvent], None,
+                    controllers.elementModified)
+
+def addThemeManager(root):
+    tmutil = root[u'themes'] = ThemeManagement()
+    ztapi.provideUtility(IThemeManagement, tmutil, name=u'themes')
+    return tmutil
+
+def addThemeSkeleton(tmutil):
+    theme = elements.theme.Theme()
+    tmutil.addTheme(theme)
+    theme[u'page'] = elements.themepage.ThemePage()
+    theme[u'page'][u'block'] = elements.pageblock.PageBlock()
+    theme[u'page'][u'block'][u'cell'] = elements.cell.Cell()
+    return theme
+

Modified: cpsskins/branches/jmo-perspectives/tests/test_filters.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/tests/test_filters.py    (original)
+++ cpsskins/branches/jmo-perspectives/tests/test_filters.py    Sun Dec 11 
00:15:03 2005
@@ -27,6 +27,7 @@
     return unittest.TestSuite((
         DocTestSuite('cpsskins.engines.default.filters.widget', setUp=setUp),
         DocTestSuite('cpsskins.engines.default.filters.layout', setUp=setUp),
+        DocTestSuite('cpsskins.engines.default.filters.effect', setUp=setUp),
         DocTestSuite('cpsskins.engines.default.filters.style', setUp=setUp),
         DocTestSuite('cpsskins.engines.default.filters.htmlcleaner',
                      setUp=setUp),

Modified: cpsskins/branches/jmo-perspectives/tests/test_perspective.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/tests/test_perspective.py        
(original)
+++ cpsskins/branches/jmo-perspectives/tests/test_perspective.py        Sun Dec 
11 00:15:03 2005
@@ -23,7 +23,7 @@
 
 def test_suite():
     return unittest.TestSuite((
-        DocTestSuite('cpsskins.perspectives'),
+        DocTestSuite('cpsskins.perspectives.perspective'),
         ))
 
 if __name__ == '__main__':

Modified: cpsskins/branches/jmo-perspectives/tests/test_portlet.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/tests/test_portlet.py    (original)
+++ cpsskins/branches/jmo-perspectives/tests/test_portlet.py    Sun Dec 11 
00:15:03 2005
@@ -27,7 +27,6 @@
     return unittest.TestSuite((
         doctest.DocFileSuite('../doc/local-portlets.txt', setUp=setUp),
         doctest.DocFileSuite('../doc/portlet-rendering.txt', setUp=setUp),
-        doctest.DocFileSuite('../doc/portlet-ordering.txt', setUp=setUp),
         ))
 
 if __name__ == '__main__':
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to