[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests - AdderBaseTests.py:1.1.2.1.4.1

Barry Warsaw barry@wooz.org
Thu, 21 Mar 2002 19:27:27 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv22971/lib/python/Zope/App/OFS/Container/Views/Browser/tests

Modified Files:
      Tag: contextual-directives
	AdderBaseTests.py 
Log Message:
This is work to pass context to zcml directives, so that directives
know where they live.  This is inspired by some suggested changes to
the naming syntax that Stephan and I discussed with Jim.
Specifically, a leading dot, as in

    .JobBoardEx.JobList.

would signify a name relative to the current package, instead of
relative to ZopeProducts.  Also, we'd like to change the trailing dot
to a `+' for signifying "look-the-last-name-up-recursively-until-you-
can't-anymore".  E.g.:

    .JobBoardEx.JobList+

I'm committing this on a branch because it breaks the unit tests and
I'm not sure of the best way to fix the remaining 10 failures.  Jim
suggests that we commit these to the branch so that he can work on
them too.


=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests/AdderBaseTests.py 1.1.2.1 => 1.1.2.1.4.1 ===
 from Zope.App.ZMI.provideClass import provideClass
 from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
+import Zope.Configuration.name
 
 class Foo: pass
 class Bar: pass
@@ -84,24 +85,27 @@
             Can we get add an object back when some classes have
             been registered?
         """
-        provideClass( self._TestAdderView__registry()
-                    ,  qualified_name='Zope.App.OFS.tests.testContainerAdd.Foo'
-                    , _class=Foo
-                    , permission=AddPermission
-                    , title='Foo'
-                    )
-        provideClass(self._TestAdderView__registry()
-                    , qualified_name='Zope.App.OFS.tests.testContainerAdd.Bar'
-                    , _class=Bar
-                    , permission=AddPermission
-                    , title='Bar'
-                    )
-        provideClass(self._TestAdderView__registry()
-                    , qualified_name='Zope.App.OFS.tests.testContainerAdd.Baz'
-                    , _class=Baz
-                    , permission=AddPermission
-                    , title='Baz'
-                    )
+        provideClass(Zope.Configuration.name,
+                     self._TestAdderView__registry(),
+                     qualified_name='Zope.App.OFS.tests.testContainerAdd.Foo',
+                     _class=Foo,
+                     permission=AddPermission,
+                     title='Foo'
+                     )
+        provideClass(Zope.Configuration.name,
+                     self._TestAdderView__registry(),
+                     qualified_name='Zope.App.OFS.tests.testContainerAdd.Bar',
+                     _class=Bar,
+                     permission=AddPermission,
+                     title='Bar'
+                     )
+        provideClass(Zope.Configuration.name,
+                     self._TestAdderView__registry(),
+                     qualified_name='Zope.App.OFS.tests.testContainerAdd.Baz',
+                     _class=Baz,
+                     permission=AddPermission,
+                     title='Baz',
+                     )
 
         container = self._TestView__newContext()
         fa = self._TestView__newView( container )
@@ -125,12 +129,13 @@
     def setUp(self):
         CleanUp.setUp(self)
         container = self._TestView__newContext()        
-        provideClass(self._TestAdderView__registry()
-                    , qualified_name='Zope.App.OFS.Container'
-                    , _class=container.__class__
-                    , permission=AddPermission
-                    , title='Container'
-                    )
+        provideClass(Zope.Configuration.name,
+                     self._TestAdderView__registry(),
+                     qualified_name='Zope.App.OFS.Container',
+                     _class=container.__class__,
+                     permission=AddPermission,
+                     title='Container',
+                     )
 
     def testAdding(self):
         """