[Zope-CVS] CVS: Packages/FunctionalTests/FunctionalTests/tests - test_Result.py:1.4.4.1

Karl Anderson cvs-admin at zope.org
Thu Nov 13 16:19:17 EST 2003


Update of /cvs-repository/Packages/FunctionalTests/FunctionalTests/tests
In directory cvs.zope.org:/tmp/cvs-serv1578

Modified Files:
      Tag: kra-intersest-branch
	test_Result.py 
Log Message:
ResultTests: add hook checks to existing tests


=== Packages/FunctionalTests/FunctionalTests/tests/test_Result.py 1.4 => 1.4.4.1 ===
--- Packages/FunctionalTests/FunctionalTests/tests/test_Result.py:1.4	Fri Jun 13 23:22:55 2003
+++ Packages/FunctionalTests/FunctionalTests/tests/test_Result.py	Thu Nov 13 16:19:16 2003
@@ -17,12 +17,13 @@
 class FauxRequest:
 
     def __init__( self, name, result, time
-                , redirect=None, checker=None ):
+                , redirect=None, checker=None, hook=None ):
         self._name      = name
         self._result    = result
         self._redirect  = redirect
         self._time      = time
         self._checker   = checker
+        self._hook      = hook
 
     def getName( self ):
         return self._name
@@ -39,6 +40,9 @@
     def getPayloadChecker( self ):
         return self._checker
 
+    def getHook( self ):
+        return self._hook
+
 
 MARKER = []
 MARKER2 = []
@@ -67,12 +71,14 @@
                               , time_requests=0
                               , check_responses=0
                               , check_elapsed_times=0
+                              , check_hook=0
                               )
 
         self.failUnless( apathy.getTest() is MARKER )
         self.failIf( apathy.timeRequests() )
         self.failIf( apathy.checkResponses() )
         self.failIf( apathy.checkElapsedTimes() )
+        self.failIf( apathy.checkHook() )
 
         apathy.addInvocation( FauxInvocation( 500, 3600.0 )
                             , FauxRequest( 'foo', 200, 1.0 )
@@ -88,12 +94,14 @@
                               , time_requests=0
                               , check_responses=1
                               , check_elapsed_times=0
+                              , check_hook=0
                               )
 
         self.failUnless( driven.getTest() is MARKER )
         self.failIf( driven.timeRequests() )
         self.failUnless( driven.checkResponses() )
         self.failIf( driven.checkElapsedTimes() )
+        self.failIf( driven.checkHook() )
 
         driven.addInvocation( FauxInvocation( 500, 3600.0 )
                             , FauxRequest( 'foo', 200, 1.0 )
@@ -109,6 +117,7 @@
                                   , time_requests=0
                                   , check_responses=0
                                   , check_elapsed_times=1
+                                  , check_hook=0
                                   )
 
         self.failIf( consistent.timeRequests() )
@@ -117,6 +126,7 @@
                               , time_requests=1
                               , check_responses=0
                               , check_elapsed_times=1
+                              , check_hook=0
                               )
 
         self.failUnless( really.timeRequests() )
@@ -125,12 +135,14 @@
                                  , time_requests=1
                                  , check_responses=0
                                  , check_elapsed_times=1
+                                 , check_hook=0
                                  )
 
         self.failUnless( impatiens.getTest() is MARKER )
         self.failUnless( impatiens.timeRequests() )
         self.failIf( impatiens.checkResponses() )
         self.failUnless( impatiens.checkElapsedTimes() )
+        self.failIf( impatiens.checkHook() )        
 
         impatiens.addInvocation( FauxInvocation( 500, 3600.0 )
                             , FauxRequest( 'foo', 200, 1.0 )
@@ -148,6 +160,7 @@
         self.failUnless( top.timeRequests() )
         self.failUnless( top.checkResponses() )
         self.failUnless( top.checkElapsedTimes() )
+        self.failUnless( top.checkHook() )
 
         child = top.newChild( test=MARKER2 )
 
@@ -155,6 +168,7 @@
         self.assertEquals( child.timeRequests(), top.timeRequests() )
         self.assertEquals( child.checkResponses(), top.checkResponses() )
         self.assertEquals( child.checkElapsedTimes(), top.checkElapsedTimes() )
+        self.assertEquals( child.checkHook(), top.checkHook() )
 
         child.addInvocation( FauxInvocation( 500, 3600.0 )
                             , FauxRequest( 'foo', 200, 1.0 )
@@ -177,6 +191,7 @@
                            , time_requests=0
                            , check_responses=0
                            , check_elapsed_times=0
+                           , check_hook=0
                            )
         child = top.newChild( test=MARKER2 )
         self.failUnless( child.getApplication() is top.getApplication() )
@@ -184,6 +199,7 @@
         self.assertEquals( child.timeRequests(), top.timeRequests() )
         self.assertEquals( child.checkResponses(), top.checkResponses() )
         self.assertEquals( child.checkElapsedTimes(), top.checkElapsedTimes() )
+        self.assertEquals( child.checkHook(), top.checkHook() )
 
 
 def test_suite():




More information about the Zope-CVS mailing list