ATLAS Offline Software
Loading...
Searching...
No Matches
python.PythonConfig.TestAlgPrivateTool Class Reference

Test case for using private tools. More...

Inheritance diagram for python.PythonConfig.TestAlgPrivateTool:
Collaboration diagram for python.PythonConfig.TestAlgPrivateTool:

Public Member Functions

 setUp (self)
 Set up the main algorithm object to test.
 test_privatetool (self)
 Test setting up and using one private tool.
 test_privatetoolarray (self)
 Test setting up and using one private tool.
 test_privatetoolofprivatetool (self)
 Test setting up and using a private tool of a private tool.
 test_nonexistentprop (self)
 Test that unset properties on the tools can't be used.
 test_nonexistenttool (self)
 Test that private tools can't be set up on not-yet-declared tools.

Public Attributes

 config = PythonConfig( "AlgType/AlgName" )

Detailed Description

Test case for using private tools.

Definition at line 475 of file PythonConfig.py.

Member Function Documentation

◆ setUp()

python.PythonConfig.TestAlgPrivateTool.setUp ( self)

Set up the main algorithm object to test.

Definition at line 478 of file PythonConfig.py.

478 def setUp( self ):
479 self.config = PythonConfig( "AlgType/AlgName" )
480 pass
481

◆ test_nonexistentprop()

python.PythonConfig.TestAlgPrivateTool.test_nonexistentprop ( self)

Test that unset properties on the tools can't be used.

Definition at line 511 of file PythonConfig.py.

511 def test_nonexistentprop( self ):
512 self.config.addPrivateTool( "Tool1", "ToolType1" )
513 with self.assertRaises( AttributeError ):
514 value = self.config.Tool1.BadProp
515 pass
516 self.config.addPrivateTool( "Tool1.Tool2", "ToolType2" )
517 with self.assertRaises( AttributeError ):
518 value = self.config.Tool1.Tool2.BadProp
519 pass
520 pass
521

◆ test_nonexistenttool()

python.PythonConfig.TestAlgPrivateTool.test_nonexistenttool ( self)

Test that private tools can't be set up on not-yet-declared tools.

Definition at line 523 of file PythonConfig.py.

523 def test_nonexistenttool( self ):
524 with self.assertRaises( AttributeError ):
525 self.config.addPrivateTool( "BadTool.Tool4", "BadToolType" )
526 pass
527 pass

◆ test_privatetool()

python.PythonConfig.TestAlgPrivateTool.test_privatetool ( self)

Test setting up and using one private tool.

Definition at line 483 of file PythonConfig.py.

483 def test_privatetool( self ):
484 self.config.addPrivateTool( "Tool1", "ToolType1" )
485 self.config.Tool1.Prop1 = "Value1"
486 self.config.Tool1.Prop2 = [ 1, 2, 3 ]
487 self.assertEqual( self.config.Tool1.Prop1, "Value1" )
488 self.assertEqual( self.config.Tool1.Prop2, [ 1, 2, 3 ] )
489 pass
490

◆ test_privatetoolarray()

python.PythonConfig.TestAlgPrivateTool.test_privatetoolarray ( self)

Test setting up and using one private tool.

Definition at line 492 of file PythonConfig.py.

492 def test_privatetoolarray( self ):
493 tool = self.config.addPrivateToolInArray( "Tool1", "ToolType1" )
494 tool.Prop1 = "Value1"
495 tool.Prop2 = [ 1, 2, 3 ]
496 self.assertEqual( tool.Prop1, "Value1" )
497 self.assertEqual( tool.Prop2, [ 1, 2, 3 ] )
498 pass
499

◆ test_privatetoolofprivatetool()

python.PythonConfig.TestAlgPrivateTool.test_privatetoolofprivatetool ( self)

Test setting up and using a private tool of a private tool.

Definition at line 501 of file PythonConfig.py.

501 def test_privatetoolofprivatetool( self ):
502 self.config.addPrivateTool( "Tool1", "ToolType1" )
503 self.config.addPrivateTool( "Tool1.Tool2", "ToolType2" )
504 self.config.Tool1.Tool2.Prop3 = "Foo"
505 self.config.Tool1.Tool2.Prop4 = [ "Bar" ]
506 self.assertEqual( self.config.Tool1.Tool2.Prop3, "Foo" )
507 self.assertEqual( self.config.Tool1.Tool2.Prop4, [ "Bar" ] )
508 pass
509

Member Data Documentation

◆ config

python.PythonConfig.TestAlgPrivateTool.config = PythonConfig( "AlgType/AlgName" )

Definition at line 479 of file PythonConfig.py.


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