[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI/tests - testProvideClass.py:1.1.2.4.6.1

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


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

Modified Files:
      Tag: contextual-directives
	testProvideClass.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/ZMI/tests/testProvideClass.py 1.1.2.4 => 1.1.2.4.6.1 ===
 import unittest, sys, Interface
 from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
-
+import Zope.Configuration.name
 
 class MyAddableObject:
     pass
@@ -29,7 +29,8 @@
         from Zope.App.ZMI import provideClass
         from Zope.App.ZMI.Addable import ContentAddables
 
-        provideClass(ContentAddables, 'My.Test.Addable', MyAddableObject,
+        provideClass(Zope.Configuration.name,
+                     ContentAddables, 'My.Test.Addable', MyAddableObject,
                      None, 'Testing')
 
         object = createObject(None,'My.Test.Addable')