ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.AlgSequence.TestAlgSequenceWithAlgsAndSeqs Class Reference

Test case for a sequence with algorithms and sub-sequences. More...

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

Public Member Functions

def setUp (self)
 Function setting up the (elaborate) sequence to be tested. More...
 
def test_sequenceBasics (self)
 Test basic features of the algorithm sequence. More...
 
def test_indexLookup (self)
 Test index lookup operations on the algorithm sequence. More...
 
def test_nameLookup (self)
 Test 'by name' lookup operations on the algorithm sequence. More...
 
def test_iteration (self)
 Test the ability to iterate over the algorithms in the sequence. More...
 

Public Attributes

 seq
 

Detailed Description

Test case for a sequence with algorithms and sub-sequences.

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

Member Function Documentation

◆ setUp()

def python.AlgSequence.TestAlgSequenceWithAlgsAndSeqs.setUp (   self)

Function setting up the (elaborate) sequence to be tested.

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

376  def setUp( self ):
377  self.seq = AlgSequence( 'MainSequence' )
378  self.seq += AnaAlgorithmConfig( 'PreSelectionAlg/PreSelection' )
379  self.seq += AlgSequence( 'MuonSequence' )
380  self.seq.MuonSequence += \
381  AnaAlgorithmConfig( 'MuonAnalysisAlg/MuonAnalysis' )
382  self.seq.MuonSequence += \
383  AnaAlgorithmConfig( 'MuonHistoAlg/MuonHistogramming' )
384  self.seq += AlgSequence( 'JetSequence' )
385  self.seq.JetSequence += AlgSequence( 'JetPreSequence' )
386  self.seq.JetSequence.JetPreSequence += \
387  AnaAlgorithmConfig( 'JetPreSelectorAlg/JetPreSelector' )
388  self.seq.JetSequence.JetPreSequence += \
389  AnaAlgorithmConfig( 'JetDecoratorAlg/JetDecorator' )
390  self.seq.JetSequence += \
391  AnaAlgorithmConfig( 'JetAnalysisAlg/JetAnalysis' )
392  self.seq.JetSequence += \
393  AnaAlgorithmConfig( 'JetHistoAlg/JetHistogramming' )
394  self.seq += AnaAlgorithmConfig( 'PostProcessingAlg/PostProcessing' )
395  return
396 

◆ test_indexLookup()

def python.AlgSequence.TestAlgSequenceWithAlgsAndSeqs.test_indexLookup (   self)

Test index lookup operations on the algorithm sequence.

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

403  def test_indexLookup( self ):
404  self.assertEqual( self.seq[ 0 ].name(), 'PreSelection' )
405  self.assertEqual( self.seq[ 2 ].name(), 'JetSequence' )
406  with self.assertRaises( IndexError ):
407  self.seq[ 4 ]
408  pass
409  return
410 

◆ test_iteration()

def python.AlgSequence.TestAlgSequenceWithAlgsAndSeqs.test_iteration (   self)

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

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

425  def test_iteration( self ):
426  algNames = [ alg.name() for alg in self.seq ]
427  self.assertEqual( algNames, [ 'PreSelection', 'MuonAnalysis',
428  'MuonHistogramming', 'JetPreSelector',
429  'JetDecorator', 'JetAnalysis',
430  'JetHistogramming',
431  'PostProcessing' ] )
432  return
433 

◆ test_nameLookup()

def python.AlgSequence.TestAlgSequenceWithAlgsAndSeqs.test_nameLookup (   self)

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

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

412  def test_nameLookup( self ):
413  self.assertEqual( self.seq.MuonSequence.MuonAnalysis.type(),
414  'MuonAnalysisAlg' )
415  self.assertEqual( self.seq.JetSequence.JetHistogramming.type(),
416  'JetHistoAlg' )
417  self.assertEqual( self.seq.JetSequence.JetPreSequence.JetDecorator.type(),
418  'JetDecoratorAlg' )
419  with self.assertRaises( AttributeError ):
420  self.seq.MuonSequence.InvalidAlg.type()
421  pass
422  return
423 

◆ test_sequenceBasics()

def python.AlgSequence.TestAlgSequenceWithAlgsAndSeqs.test_sequenceBasics (   self)

Test basic features of the algorithm sequence.

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

398  def test_sequenceBasics( self ):
399  self.assertEqual( len( self.seq ), 4 )
400  return
401 

Member Data Documentation

◆ seq

python.AlgSequence.TestAlgSequenceWithAlgsAndSeqs.seq

The documentation for this class was generated from the following file:
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195