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 445 of file PythonConfig.py.

Member Function Documentation

◆ setUp()

python.PythonConfig.TestAlgPrivateTool.setUp ( self)

Set up the main algorithm object to test.

Definition at line 448 of file PythonConfig.py.

448 def setUp( self ):
449 self.config = PythonConfig( "AlgType/AlgName" )
450

◆ test_nonexistentprop()

python.PythonConfig.TestAlgPrivateTool.test_nonexistentprop ( self)

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

Definition at line 477 of file PythonConfig.py.

477 def test_nonexistentprop( self ):
478 self.config.addPrivateTool( "Tool1", "ToolType1" )
479 with self.assertRaises( AttributeError ):
480 value = self.config.Tool1.BadProp
481 self.config.addPrivateTool( "Tool1.Tool2", "ToolType2" )
482 with self.assertRaises( AttributeError ):
483 value = self.config.Tool1.Tool2.BadProp
484

◆ 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 486 of file PythonConfig.py.

486 def test_nonexistenttool( self ):
487 with self.assertRaises( AttributeError ):
488 self.config.addPrivateTool( "BadTool.Tool4", "BadToolType" )

◆ test_privatetool()

python.PythonConfig.TestAlgPrivateTool.test_privatetool ( self)

Test setting up and using one private tool.

Definition at line 452 of file PythonConfig.py.

452 def test_privatetool( self ):
453 self.config.addPrivateTool( "Tool1", "ToolType1" )
454 self.config.Tool1.Prop1 = "Value1"
455 self.config.Tool1.Prop2 = [ 1, 2, 3 ]
456 self.assertEqual( self.config.Tool1.Prop1, "Value1" )
457 self.assertEqual( self.config.Tool1.Prop2, [ 1, 2, 3 ] )
458

◆ test_privatetoolarray()

python.PythonConfig.TestAlgPrivateTool.test_privatetoolarray ( self)

Test setting up and using one private tool.

Definition at line 460 of file PythonConfig.py.

460 def test_privatetoolarray( self ):
461 tool = self.config.addPrivateToolInArray( "Tool1", "ToolType1" )
462 tool.Prop1 = "Value1"
463 tool.Prop2 = [ 1, 2, 3 ]
464 self.assertEqual( tool.Prop1, "Value1" )
465 self.assertEqual( tool.Prop2, [ 1, 2, 3 ] )
466

◆ test_privatetoolofprivatetool()

python.PythonConfig.TestAlgPrivateTool.test_privatetoolofprivatetool ( self)

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

Definition at line 468 of file PythonConfig.py.

468 def test_privatetoolofprivatetool( self ):
469 self.config.addPrivateTool( "Tool1", "ToolType1" )
470 self.config.addPrivateTool( "Tool1.Tool2", "ToolType2" )
471 self.config.Tool1.Tool2.Prop3 = "Foo"
472 self.config.Tool1.Tool2.Prop4 = [ "Bar" ]
473 self.assertEqual( self.config.Tool1.Tool2.Prop3, "Foo" )
474 self.assertEqual( self.config.Tool1.Tool2.Prop4, [ "Bar" ] )
475

Member Data Documentation

◆ config

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

Definition at line 449 of file PythonConfig.py.


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