[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - ResourceService.py:1.1.2.3 Service.py:1.1.6.6 SkinService.py:1.1.2.4 ViewService.py:1.1.2.13 hooks.py:1.1.2.14

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


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

Modified Files:
      Tag: Zope-3x-branch
	ResourceService.py Service.py SkinService.py ViewService.py 
	hooks.py 
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/ComponentArchitecture/ResourceService.py 1.1.2.2 => 1.1.2.3 ===
 
 
-
+# Register our cleanup with Testing.CleanUp to make writing unit tests simpler.
+from Zope.Testing.CleanUp import addCleanUp
+addCleanUp(_clear)
+del addCleanUp


=== Zope3/lib/python/Zope/ComponentArchitecture/Service.py 1.1.6.5 => 1.1.6.6 ===
 
 
+# Register our cleanup with Testing.CleanUp to make writing unit tests simpler.
+from Zope.Testing.CleanUp import addCleanUp
+addCleanUp(_clear)
+del addCleanUp
+
 def getService(object, name):
     """
     context based lookup, with fallback to component architecture


=== Zope3/lib/python/Zope/ComponentArchitecture/SkinService.py 1.1.2.3 => 1.1.2.4 ===
 getSkin    = skinService.getSkin
 _clear     = skinService._clear
+
+# Register our cleanup with Testing.CleanUp to make writing unit tests simpler.
+from Zope.Testing.CleanUp import addCleanUp
+addCleanUp(_clear)
+del addCleanUp


=== Zope3/lib/python/Zope/ComponentArchitecture/ViewService.py 1.1.2.12 => 1.1.2.13 ===
 getRequestDefaultViewName = viewService.getRequestDefaultViewName
 _clear         = viewService._clear
+
+
+# Register our cleanup with Testing.CleanUp to make writing unit tests simpler.
+from Zope.Testing.CleanUp import addCleanUp
+addCleanUp(_clear)
+del addCleanUp


=== Zope3/lib/python/Zope/ComponentArchitecture/hooks.py 1.1.2.13 => 1.1.2.14 ===
 
 _clear()
+
+# Register our cleanup with Testing.CleanUp to make writing unit tests simpler.
+from Zope.Testing.CleanUp import addCleanUp
+addCleanUp(_clear)
+del addCleanUp