Author: jmorliaguet
Date: Tue Dec  6 12:53:02 2005
New Revision: 1964

Modified:
   cpsskins/branches/jmo-perspectives/ftests/test_display.py
   cpsskins/branches/jmo-perspectives/ftests/test_format.py
Log:

- fixed test setup



Modified: cpsskins/branches/jmo-perspectives/ftests/test_display.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ftests/test_display.py   (original)
+++ cpsskins/branches/jmo-perspectives/ftests/test_display.py   Tue Dec  6 
12:53:02 2005
@@ -21,10 +21,18 @@
 
 from zope.testing.doctestunit import DocTestSuite
 
+
 from cpsskins.engines.default.displays.area import Area
 from cpsskins.engines.default.displays.box import Box
 from cpsskins.engines.default.displays.boxgroup import BoxGroup
 
+def setUp(test):
+    from zope.app.testing import ztapi
+    from zope.app.traversing.interfaces import IPathAdapter
+    from cpsskins.elements.display import Displayable
+    from cpsskins.elements.interfaces import IElement
+    ztapi.provideAdapter(IElement, IPathAdapter, Displayable, 'displayable')
+
 class TestArea:
     def makeTestObject(self):
         return Area()
@@ -42,10 +50,10 @@
         unittest.makeSuite(TestArea),
         unittest.makeSuite(TestBox),
         unittest.makeSuite(TestBoxGroup),
-        DocTestSuite('cpsskins.elements.display'),
-        DocTestSuite('cpsskins.engines.default.displays.area'),
-        DocTestSuite('cpsskins.engines.default.displays.box'),
-        DocTestSuite('cpsskins.engines.default.displays.boxgroup'),
+        DocTestSuite('cpsskins.elements.display', setUp=setUp),
+        DocTestSuite('cpsskins.engines.default.displays.area', setUp=setUp),
+        DocTestSuite('cpsskins.engines.default.displays.box', setUp=setUp),
+        DocTestSuite('cpsskins.engines.default.displays.boxgroup', 
setUp=setUp),
         ))
 
 if __name__ == '__main__':

Modified: cpsskins/branches/jmo-perspectives/ftests/test_format.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ftests/test_format.py    (original)
+++ cpsskins/branches/jmo-perspectives/ftests/test_format.py    Tue Dec  6 
12:53:02 2005
@@ -25,6 +25,25 @@
 from cpsskins.engines.default.formats.style import Style
 from cpsskins.engines.default.formats.widget import Widget
 
+def setUp(test):
+    from zope.app.testing import ztapi, setup
+    from zope.app.traversing.interfaces import IPathAdapter
+
+    from cpsskins.elements.display import Displayable
+    from cpsskins.elements.format import Formattable
+    from cpsskins.elements.interfaces import IElement, IDisplay
+    from cpsskins.relations.interfaces import IRelationTool, IRelationStorage
+    from cpsskins.relations.tool import RelationTool
+    from cpsskins.relations.storage import RelationStorage
+
+    ztapi.provideAdapter(IElement, IPathAdapter, Displayable, 'displayable')
+    ztapi.provideAdapter(IDisplay, IPathAdapter, Formattable, 'formattable')
+    ztapi.provideAdapter(IElement, IRelationTool, RelationTool)
+    ztapi.provideAdapter(None, IRelationStorage, RelationStorage)
+    ztapi.provideUtility(IRelationStorage, RelationStorage())
+
+    setup.setUpSiteManagerLookup()
+
 class TestLayout:
     def makeTestObject(self):
         return Layout()
@@ -42,10 +61,10 @@
         unittest.makeSuite(TestLayout),
         unittest.makeSuite(TestStyle),
         unittest.makeSuite(TestWidget),
-        DocTestSuite('cpsskins.elements.format'),
-        DocTestSuite('cpsskins.engines.default.formats.layout'),
-        DocTestSuite('cpsskins.engines.default.formats.style'),
-        DocTestSuite('cpsskins.engines.default.formats.widget'),
+        DocTestSuite('cpsskins.elements.format', setUp=setUp),
+        DocTestSuite('cpsskins.engines.default.formats.layout', setUp=setUp),
+        DocTestSuite('cpsskins.engines.default.formats.style', setUp=setUp),
+        DocTestSuite('cpsskins.engines.default.formats.widget', setUp=setUp),
         ))
 
 if __name__ == '__main__':
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to