[Zope-CVS] CVS: Packages/FunctionalTests/tests - test_Scenario.py:1.2

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


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

Modified Files:
	test_Scenario.py 
Log Message:
 - Add mechanism for parsing (simplest) load sequences.

=== Packages/FunctionalTests/tests/test_Scenario.py 1.1 => 1.2 ===
         self.failIf( empty.getLoadSequence() )
 
+        self.failIf( empty.hasLoadRequests() )
+        self.assertRaises( IndexError, empty.nextLoadRequest )
+
     def _makeRequests( self, *ids ):
 
         result = []
@@ -142,6 +145,24 @@
         self.assertEquals( r, result )
         self.failUnless( result.isAbend() )
         self.assertEquals( len( result.listInvocations() ), 2 )
+
+    def test_setLoadSequence_simple( self ):
+
+        loader = self._makeOne()
+
+        loader.setLoadSequence( 'a b c' )
+
+        self.failUnless( loader.hasLoadRequests() )
+        self.assertEqual( loader.nextLoadRequest(), 'a' )
+
+        self.failUnless( loader.hasLoadRequests() )
+        self.assertEqual( loader.nextLoadRequest(), 'b' )
+
+        self.failUnless( loader.hasLoadRequests() )
+        self.assertEqual( loader.nextLoadRequest(), 'c' )
+
+        self.failIf( loader.hasLoadRequests() )
+        self.assertRaises( IndexError, loader.nextLoadRequest )
 
 def test_suite():
     return unittest.makeSuite( ScenarioTests )