[Zope-CVS] CVS: Packages/FunctionalTests - Framework.py:1.13

Tres Seaver tseaver@zope.com
Tue, 19 Mar 2002 22:08:28 -0500


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

Modified Files:
	Framework.py 
Log Message:


  - Add tests for Scenario.

  - Add accessor / mutator for "load sequence", a field used to describe
    how the scenario is to be executed when used in load testing.

    XXX:  Currently, kept only as the string read from the config file.


=== Packages/FunctionalTests/Framework.py 1.12 => 1.13 ===
         self._requests      = []
         self._postcondition = None
+        self._load_sequence = None
 
     #
     #   Accessors
@@ -964,6 +965,10 @@
 
         return tuple( self._requests )
 
+    def getLoadSequence( self ):
+        
+        return self._load_sequence
+
     #
     #   Mutators
     #
@@ -974,6 +979,13 @@
     def setPostcondition( self, postcondition ):
 
         self._postcondition = postcondition
+
+    def setLoadSequence( self, load_sequence ):
+        """
+            Store the string which indicates the sequencing to be
+            used as a load-testing script.
+        """
+        self._load_sequence = load_sequence
     
     def addRequest( self, request ):
 
@@ -1085,6 +1097,10 @@
         test = Scenario()
         test.setTitle( cp.get( _SCENARIO_SECTION, 'Title' ) )
         test.setUseCase( cp.get( _SCENARIO_SECTION, 'Use_case' ) )
+
+        if cp.has_option( _SCENARIO_SECTION, 'load_sequence' ):
+            test.setLoadSequenece( cp.get( _SCENARIO_SECTION
+                                 , 'load_sequence' ) )
 
     if _SETUP_SECTION in cp.listSpecialSections( 0 ):
         test.setSetup( _buildRequest( cp, _SETUP_SECTION ) )