279 def test_findAlgorithms( self ):
280 a1 = findAlgorithm( self.top, "SomeAlg0" )
281 self.assertIsNotNone( a1, "Can't find algorithm present in sequence" )
282
283 a1 = findAlgorithm( self.top, "SomeAlg1" )
284 self.assertIsNotNone( a1, "Can't find nested algorithm " )
285
286 nest2 = findSubSequence( self.top, "nest2" )
287
288 a1 = findAlgorithm( nest2, "SomeAlg0" )
289 self.assertIsNone( a1, "Finding algorithm that is in the upper sequence" )
290
291 a1 = findAlgorithm( nest2, "NonexistentAlg" )
292 self.assertIsNone( a1, "Finding algorithm that is does not exist" )
293
294 a1 = findAlgorithm( self.top, "SomeAlg0", 1)
295 self.assertIsNotNone( a1, "Could not find algorithm within the required nesting depth == 1" )
296
297 a1 = findAlgorithm( self.top, "SomeAlg1", 1)
298 self.assertIsNone( a1, "Could find algorithm even if it is deep in sequences structure" )
299
300 a1 = findAlgorithm( self.top, "SomeAlg1", 2)
301 self.assertIsNotNone( a1, "Could not find algorithm within the required nesting depth == 2" )
302
303 a1 = findAlgorithm( self.top, "SomeAlg3", 2)
304 self.assertIsNotNone( a1 is None, "Could find algorithm even if it is deep in sequences structure" )
305
306