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_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 315 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 318 of file PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py.

318 def setUp( self ):
319 self.seq = AlgSequence( 'TestSequence' )
320 self.seq += AnaAlgorithmConfig( 'AlgType1/Algorithm1' )
321 self.seq += AnaAlgorithmConfig( 'AlgType2/Algorithm2' )
322 return
323

◆ test_deleteAlg()

python.AlgSequence.TestAlgSequenceWithAlgs.test_deleteAlg ( self)

Test the deletion of an algorithm.

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

364 def test_deleteAlg( self ):
365 del self.seq.Algorithm1
366 self.assertEqual( len( self.seq ), 1 )
367 self.assertEqual( self.seq[ 0 ].name(), 'Algorithm2' )
368 return
369

◆ test_indexLookup()

python.AlgSequence.TestAlgSequenceWithAlgs.test_indexLookup ( self)

Test index lookup operations on the algorithm sequence.

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

331 def test_indexLookup( self ):
332 self.assertEqual( self.seq[ 0 ].name(), 'Algorithm1' )
333 self.assertEqual( self.seq[ 1 ].name(), 'Algorithm2' )
334 with self.assertRaises( IndexError ):
335 self.seq[ 2 ]
336 pass
337 return
338

◆ test_insertAlg()

python.AlgSequence.TestAlgSequenceWithAlgs.test_insertAlg ( self)

Test the insertion of one algorithm.

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

355 def test_insertAlg( self ):
356 self.seq.insert( 1, AnaAlgorithmConfig( 'AlgType3/Algorithm3' ) )
357 self.assertEqual( len( self.seq ), 3 )
358 self.assertEqual( self.seq[ 0 ].name(), 'Algorithm1' )
359 self.assertEqual( self.seq[ 1 ].name(), 'Algorithm3' )
360 self.assertEqual( self.seq[ 2 ].name(), 'Algorithm2' )
361 return
362

◆ test_iteration()

python.AlgSequence.TestAlgSequenceWithAlgs.test_iteration ( self)

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

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

349 def test_iteration( self ):
350 algNames = [ alg.name() for alg in self.seq ]
351 self.assertEqual( algNames, [ 'Algorithm1', 'Algorithm2' ] )
352 return
353

◆ test_nameLookup()

python.AlgSequence.TestAlgSequenceWithAlgs.test_nameLookup ( self)

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

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

340 def test_nameLookup( self ):
341 self.assertEqual( self.seq.Algorithm1.type(), 'AlgType1' )
342 self.assertEqual( self.seq.Algorithm2.type(), 'AlgType2' )
343 with self.assertRaises( AttributeError ):
344 self.seq.Algorithm3.type()
345 pass
346 return
347

◆ test_sequenceBasics()

python.AlgSequence.TestAlgSequenceWithAlgs.test_sequenceBasics ( self)

Test basic features of the algorithm sequence.

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

325 def test_sequenceBasics( self ):
326 self.assertEqual( self.seq.name(), 'TestSequence' )
327 self.assertEqual( len( self.seq ), 2 )
328 return
329

Member Data Documentation

◆ seq

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

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