ATLAS Offline Software
Loading...
Searching...
No Matches
python.AsgServiceConfig.TestServicePrivateTool Class Reference

Test case for using private tools. More...

Inheritance diagram for python.AsgServiceConfig.TestServicePrivateTool:
Collaboration diagram for python.AsgServiceConfig.TestServicePrivateTool:

Public Member Functions

 setUp (self)
 Set up the main service object to test.
 test_privatetool (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 = AsgServiceConfig( "ServiceType/ServiceName" )

Detailed Description

Test case for using private tools.

Definition at line 433 of file AsgServiceConfig.py.

Member Function Documentation

◆ setUp()

python.AsgServiceConfig.TestServicePrivateTool.setUp ( self)

Set up the main service object to test.

Definition at line 436 of file AsgServiceConfig.py.

436 def setUp( self ):
437 self.config = AsgServiceConfig( "ServiceType/ServiceName" )
438 pass
439

◆ test_nonexistentprop()

python.AsgServiceConfig.TestServicePrivateTool.test_nonexistentprop ( self)

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

Definition at line 460 of file AsgServiceConfig.py.

460 def test_nonexistentprop( self ):
461 self.config.addPrivateTool( "Tool1", "ToolType1" )
462 with self.assertRaises( AttributeError ):
463 value = self.config.Tool1.BadProp
464 pass
465 self.config.addPrivateTool( "Tool1.Tool2", "ToolType2" )
466 with self.assertRaises( AttributeError ):
467 value = self.config.Tool1.Tool2.BadProp
468 pass
469 pass
470

◆ test_nonexistenttool()

python.AsgServiceConfig.TestServicePrivateTool.test_nonexistenttool ( self)

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

Definition at line 472 of file AsgServiceConfig.py.

472 def test_nonexistenttool( self ):
473 with self.assertRaises( AttributeError ):
474 self.config.addPrivateTool( "BadTool.Tool4", "BadToolType" )
475 pass
476 pass

◆ test_privatetool()

python.AsgServiceConfig.TestServicePrivateTool.test_privatetool ( self)

Test setting up and using one private tool.

Definition at line 441 of file AsgServiceConfig.py.

441 def test_privatetool( self ):
442 self.config.addPrivateTool( "Tool1", "ToolType1" )
443 self.config.Tool1.Prop1 = "Value1"
444 self.config.Tool1.Prop2 = [ 1, 2, 3 ]
445 self.assertEqual( self.config.Tool1.Prop1, "Value1" )
446 self.assertEqual( self.config.Tool1.Prop2, [ 1, 2, 3 ] )
447 pass
448

◆ test_privatetoolofprivatetool()

python.AsgServiceConfig.TestServicePrivateTool.test_privatetoolofprivatetool ( self)

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

Definition at line 450 of file AsgServiceConfig.py.

450 def test_privatetoolofprivatetool( self ):
451 self.config.addPrivateTool( "Tool1", "ToolType1" )
452 self.config.addPrivateTool( "Tool1.Tool2", "ToolType2" )
453 self.config.Tool1.Tool2.Prop3 = "Foo"
454 self.config.Tool1.Tool2.Prop4 = [ "Bar" ]
455 self.assertEqual( self.config.Tool1.Tool2.Prop3, "Foo" )
456 self.assertEqual( self.config.Tool1.Tool2.Prop4, [ "Bar" ] )
457 pass
458

Member Data Documentation

◆ config

python.AsgServiceConfig.TestServicePrivateTool.config = AsgServiceConfig( "ServiceType/ServiceName" )

Definition at line 437 of file AsgServiceConfig.py.


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