[Zope-Checkins] CVS: Products/EventListenerTool/tests - testListenerTool.py:1.2

Chris McDonough chrism@zope.com
Tue, 7 Jan 2003 13:26:42 -0500


Update of /cvs-repository/Products/EventListenerTool/tests
In directory cvs.zope.org:/tmp/cvs-serv10090/tests

Modified Files:
	testListenerTool.py 
Log Message:
Make unit tests pass.


=== Products/EventListenerTool/tests/testListenerTool.py 1.1 => 1.2 ===
--- Products/EventListenerTool/tests/testListenerTool.py:1.1	Tue Jan  7 13:03:56 2003
+++ Products/EventListenerTool/tests/testListenerTool.py	Tue Jan  7 13:26:37 2003
@@ -46,8 +46,8 @@
         def _lookup( moniker, _MONIKER=_MONIKER ):
             return moniker == _MONIKER and IDummyEvent or None
 
-        from Products.BCWorkbench.Framework.ListenerTool \
-            import _setEventRegistryLookup
+        from Products.EventListenerTool.ListenerTool import \
+             _setEventRegistryLookup
 
         self._old_event_registry_lookup = _setEventRegistryLookup( _lookup )
 
@@ -55,23 +55,21 @@
 
     def _restoreEventRegistry( self ):
 
-        from Products.BCWorkbench.Framework.ListenerTool \
-            import _setEventRegistryLookup
+        from Products.EventListenerTool.ListenerTool import \
+             _setEventRegistryLookup
 
         if self._old_event_registry_lookup is not None:
             _setEventRegistryLookup( self._old_event_registry_lookup )
 
     def _prepLogger( self ):
 
-        from Products.BCWorkbench.Framework.ListenerTool \
-            import _setLogger
+        from Products.EventListenerTool.ListenerTool import _setLogger
 
         self._old_logger = _setLogger( self._fauxLog )
 
     def _restoreLogger( self ):
 
-        from Products.BCWorkbench.Framework.ListenerTool \
-            import _setLogger
+        from Products.EventListenerTool.ListenerTool import _setLogger
 
         if self._old_logger is not None:
             _setLogger( self._old_logger )
@@ -119,8 +117,7 @@
 
     def _getTargetClass( self ):
 
-        from Products.BCWorkbench.Framework.ListenerTool \
-            import ListenerRule
+        from Products.EventListenerTool.ListenerTool import ListenerRule
 
         return ListenerRule
 
@@ -136,7 +133,8 @@
     def test_verify_IEventListenerRule( self ):
 
         from Interface.Verify import verifyClass
-        from Products.BCWorkbench import IEventListenerRule
+        from Products.EventListenerTool.interfaces.IEventListenerRule \
+             import IEventListenerRule
 
         verifyClass( IEventListenerRule, self._getTargetClass() )
 
@@ -289,8 +287,7 @@
 
     def _getTargetClass( self ):
 
-        from Products.BCWorkbench.Framework.ListenerTool \
-            import ListenerTool
+        from Products.EventListenerTool.ListenerTool import ListenerTool
 
         return ListenerTool
 
@@ -301,7 +298,8 @@
     def test_verify_IEventListenerTool( self ):
 
         from Interface.Verify import verifyClass
-        from Products.BCWorkbench import IEventListenerTool
+        from Products.EventListenerTool.interfaces.IEventListenerTool import \
+             IEventListenerTool
 
         verifyClass( IEventListenerTool, self._getTargetClass() )
 
@@ -326,7 +324,8 @@
 
     def test_addRule( self ):
 
-        from Products.BCWorkbench import IEventListenerRule
+        from Products.EventListenerTool.interfaces.IEventListenerRule import \
+             IEventListenerRule
 
         tool = self._makeOne()
         MONIKER = self._prepEventRegistry()
@@ -420,8 +419,7 @@
 
     def _getTargetClass( self ):
 
-        from Products.BCWorkbench.Framework.ListenerTool \
-            import ListenerTool
+        from Products.EventListenerTool.ListenerTool import ListenerTool
 
         return ListenerTool
 
@@ -455,3 +453,14 @@
         tool.deactivate()
         self.assertEqual( len( evtool._subscriptions[ None ] ), 0 )
 
+def test_suite():
+    suite = unittest.TestSuite()
+    suite.addTest(unittest.makeSuite(ListenerRuleTests, 'test'))
+    suite.addTest(unittest.makeSuite(ListenerToolTests, 'test'))
+    suite.addTest(unittest.makeSuite(ListenerToolTests_with_context, 'test'))
+    return suite
+
+if __name__ == '__main__':
+    runner = unittest.TextTestRunner(verbosity=9)
+    runner.run(test_suite())
+