[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - Addable.py:1.1.2.3 ZMIViewService.py:1.1.2.5 zmi-meta.zcml:1.1.2.3

Jim Fulton jim@cvs.zope.org
Tue, 19 Feb 2002 11:05:39 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	Addable.py ZMIViewService.py zmi-meta.zcml 
Log Message:
Refactored tests to use a global-data cleanup framework.
This avoids a lot of messy clean-up code needed for tests that
use global registries, such as component services.

It is really important to make sure global registries get registered
with this framework.

See the doc strings in Zope.Testing.CleannUp.


=== Zope3/lib/python/Zope/App/ZMI/Addable.py 1.1.2.2 => 1.1.2.3 ===
     ServiceAddables._clear()
 
+
+# Register our cleanup with Testing.CleanUp to make writing unit tests simpler.
+from Zope.Testing.CleanUp import addCleanUp
+addCleanUp(_clear)
+del addCleanUp
+
+
 class Addable:
 
     def __init__(self, id, title, description):


=== Zope3/lib/python/Zope/App/ZMI/ZMIViewService.py 1.1.2.4 => 1.1.2.5 ===
 ZMIViews = ZMIViewService()
 
-        
-        
+# Register our cleanup with Testing.CleanUp to make writing unit tests simpler.
+from Zope.Testing.CleanUp import addCleanUp
+addCleanUp(ZMIViews._clear)
+del addCleanUp


=== Zope3/lib/python/Zope/App/ZMI/zmi-meta.zcml 1.1.2.2 => 1.1.2.3 ===
     </directive>
 
-    <directive name="icon" attributes="for, file, package, alt"
+    <directive name="icon" attributes="for, file, package, alt, layer"
                handler="Zope.App.ZMI.IconDirective." />
   </directives>