ATLAS Offline Software
Loading...
Searching...
No Matches
python.AlgSequence.TestAlgSequenceWithAlgs Class Reference

Test case for a sequence with only algorithms in it. More...

Inheritance diagram for python.AlgSequence.TestAlgSequenceWithAlgs:
Collaboration diagram for python.AlgSequence.TestAlgSequenceWithAlgs:

Public Member Functions

 setUp (self)
 Function setting up the sequence to be tested.
 test_sequenceBasics (self)
 Test basic features of the algorithm sequence.
 test_indexLookup (self)
 Test index lookup operations on the algorithm sequence.
 test_nameLookup (self)
 Test 'by name' lookup operations on the algorithm sequence.
 test_iteration (self)
 Test the ability to iterate over the algorithms in the sequence.
 test_insertAlg (self)
 Test the insertion of one algorithm.
 test_insertAlgAtFront (self)
 Test the insertion of one algorithm at the front of the sequence.
 test_deleteAlg (self)
 Test the deletion of an algorithm.

Public Attributes

 seq = AlgSequence( 'TestSequence' )

Detailed Description

Test case for a sequence with only algorithms in it.

Definition at line 294 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

Member Function Documentation

◆ setUp()

python.AlgSequence.TestAlgSequenceWithAlgs.setUp ( self)

Function setting up the sequence to be tested.

Definition at line 297 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

297 def setUp( self ):
298 self.seq = AlgSequence( 'TestSequence' )
299 self.seq += AnaAlgorithmConfig( 'AlgType1/Algorithm1' )
300 self.seq += AnaAlgorithmConfig( 'AlgType2/Algorithm2' )
301 return
302

◆ test_deleteAlg()

python.AlgSequence.TestAlgSequenceWithAlgs.test_deleteAlg ( self)

Test the deletion of an algorithm.

Definition at line 350 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

350 def test_deleteAlg( self ):
351 del self.seq.Algorithm1
352 self.assertEqual( len( self.seq ), 1 )
353 self.assertEqual( self.seq[ 0 ].name(), 'Algorithm2' )
354 return
355
356

◆ test_indexLookup()

python.AlgSequence.TestAlgSequenceWithAlgs.test_indexLookup ( self)

Test index lookup operations on the algorithm sequence.

Definition at line 310 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

310 def test_indexLookup( self ):
311 self.assertEqual( self.seq[ 0 ].name(), 'Algorithm1' )
312 self.assertEqual( self.seq[ 1 ].name(), 'Algorithm2' )
313 with self.assertRaises( IndexError ):
314 self.seq[ 2 ]
315 return
316

◆ test_insertAlg()

python.AlgSequence.TestAlgSequenceWithAlgs.test_insertAlg ( self)

Test the insertion of one algorithm.

Definition at line 332 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

332 def test_insertAlg( self ):
333 self.seq.insert( 1, AnaAlgorithmConfig( 'AlgType3/Algorithm3' ) )
334 self.assertEqual( len( self.seq ), 3 )
335 self.assertEqual( self.seq[ 0 ].name(), 'Algorithm1' )
336 self.assertEqual( self.seq[ 1 ].name(), 'Algorithm3' )
337 self.assertEqual( self.seq[ 2 ].name(), 'Algorithm2' )
338 return
339

◆ test_insertAlgAtFront()

python.AlgSequence.TestAlgSequenceWithAlgs.test_insertAlgAtFront ( self)

Test the insertion of one algorithm at the front of the sequence.

Definition at line 341 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

341 def test_insertAlgAtFront( self ):
342 self.seq.insert( 0, AnaAlgorithmConfig( 'AlgType3/Algorithm3' ) )
343 self.assertEqual( len( self.seq ), 3 )
344 self.assertEqual( self.seq[ 0 ].name(), 'Algorithm3' )
345 self.assertEqual( self.seq[ 1 ].name(), 'Algorithm1' )
346 self.assertEqual( self.seq[ 2 ].name(), 'Algorithm2' )
347 return
348

◆ test_iteration()

python.AlgSequence.TestAlgSequenceWithAlgs.test_iteration ( self)

Test the ability to iterate over the algorithms in the sequence.

Definition at line 326 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

326 def test_iteration( self ):
327 algNames = [ alg.name() for alg in self.seq ]
328 self.assertEqual( algNames, [ 'Algorithm1', 'Algorithm2' ] )
329 return
330

◆ test_nameLookup()

python.AlgSequence.TestAlgSequenceWithAlgs.test_nameLookup ( self)

Test 'by name' lookup operations on the algorithm sequence.

Definition at line 318 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

318 def test_nameLookup( self ):
319 self.assertEqual( self.seq.Algorithm1.type(), 'AlgType1' )
320 self.assertEqual( self.seq.Algorithm2.type(), 'AlgType2' )
321 with self.assertRaises( AttributeError ):
322 self.seq.Algorithm3.type()
323 return
324

◆ test_sequenceBasics()

python.AlgSequence.TestAlgSequenceWithAlgs.test_sequenceBasics ( self)

Test basic features of the algorithm sequence.

Definition at line 304 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

304 def test_sequenceBasics( self ):
305 self.assertEqual( self.seq.name(), 'TestSequence' )
306 self.assertEqual( len( self.seq ), 2 )
307 return
308

Member Data Documentation

◆ seq

python.AlgSequence.TestAlgSequenceWithAlgs.seq = AlgSequence( 'TestSequence' )

The documentation for this class was generated from the following file: