4 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
8 from AthenaPython.tests.PyTestsLib
import MyAlg, MySvc, MyTool
12 class Test( unittest.TestCase ):
18 cfg.addSequence(CompFactory.AthSequencer(
"MySeq"))
20 cfg.addEventAlgo( MyAlg(
"MyAlg1", eta = 2.5, pt = 42.),
21 sequenceName =
"MySeq" )
23 cfg.addEventAlgo( MyAlg(
"MyAlg2", eta = 5.1, pt = 20.*Units.GeV, filterPassed =
False),
24 sequenceName =
"MySeq" )
27 cfg.addEventAlgo( MyAlg(
"MyAlg3", eta = 4.9, pt = 15.*Units.GeV,
28 mytool = MyTool(
"MyTool", counter = 50, parent=
"MyAlg3")),
29 sequenceName =
"MySeq" )
31 cfg.addService( MySvc(), create=
True )
33 with open(
'test_CA.pkl',
'wb')
as f:
36 self.assertFalse(sc.isFailure())
41 cfg1.addEventAlgo( MyAlg(name=
'Alg1', px=1) )
42 cfg2.addEventAlgo( MyAlg(name=
'Alg2', px=2) )
49 cfg1.addEventAlgo( MyAlg(px=1) )
50 cfg2.addEventAlgo( MyAlg(px=2) )
51 with self.assertRaises(ValueError):
55 if __name__ ==
"__main__":