[Zope-CVS] CVS: Packages/FunctionalTests/tests - test_Scenario.py:1.3
Tres Seaver
tseaver@zope.com
Wed, 20 Mar 2002 07:13:50 -0500
Update of /cvs-repository/Packages/FunctionalTests/tests
In directory cvs.zope.org:/tmp/cvs-serv5039/tests
Modified Files:
test_Scenario.py
Log Message:
- Clean up imports.
- Switch to using Python expressions for load sequence string,
to permit "looping" via tuple expansion.
=== Packages/FunctionalTests/tests/test_Scenario.py 1.2 => 1.3 ===
loader = self._makeOne()
- loader.setLoadSequence( 'a b c' )
+ expr = "'a', 'b', 'c'"
+ loader.setLoadSequence( expr )
+ self.assertEquals( loader.getLoadSequence(), expr )
- self.failUnless( loader.hasLoadRequests() )
- self.assertEqual( loader.nextLoadRequest(), 'a' )
+ for next_name in ( 'a', 'b', 'c' ):
+ self.failUnless( loader.hasLoadRequests() )
+ self.assertEqual( loader.nextLoadRequest(), next_name )
- self.failUnless( loader.hasLoadRequests() )
- self.assertEqual( loader.nextLoadRequest(), 'b' )
+ self.failIf( loader.hasLoadRequests() )
+ self.assertRaises( IndexError, loader.nextLoadRequest )
- self.failUnless( loader.hasLoadRequests() )
- self.assertEqual( loader.nextLoadRequest(), 'c' )
+ def test_setLoadSequence_loop( self ):
+
+ loader = self._makeOne()
+
+ loader.setLoadSequence( "( 'a', 'b', 'c' ) * 10" )
+
+ for iter in range( 10 ):
+ for next_name in ( 'a', 'b', 'c' ):
+ self.failUnless( loader.hasLoadRequests() )
+ self.assertEqual( loader.nextLoadRequest(), next_name )
self.failIf( loader.hasLoadRequests() )
self.assertRaises( IndexError, loader.nextLoadRequest )