CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes
Config.TestModuleCommand Class Reference
Inheritance diagram for Config.TestModuleCommand:

Public Member Functions

def setUp
 
def testCloneSequence
 
def testContains
 
def testDelete
 
def testExamples
 
def testFinalPath
 
def testFreeze
 
def testGlobalReplace
 
def testImplicitSchedule
 
def testMaxEvents
 
def testModifier
 
def testOptions
 
def testOverride
 
def testParameterizable
 
def testPath
 
def testPrefers
 
def testProcessDumpPython
 
def testProcessExtend
 
def testProcessFragment
 
def testProcessInsertion
 
def testPrune
 
def testRefToPSet
 
def testSchedule
 
def testSecSource
 
def testSequence
 
def testSequence2
 
def testServiceInProcess
 
def testSubProcess
 
def testSwitchProducer
 
def testTask
 
def testTaskPlaceholder
 
def testTypedParameterizable
 
def testUsing
 

Public Attributes

 a
 
 proc_mod_
 

Static Public Attributes

tuple a = EDProducer("A")
 
tuple d = p.dumpPython()
 
tuple p = Process("test")
 
tuple process = Process("DUMP")
 
tuple s = Sequence(p.a)
 
tuple s1 = Sequence(s)
 
tuple s2 = Sequence(a)
 
tuple s3 = Sequence(a+a)
 
tuple task2 = Task(p.f, p.g)
 

Detailed Description

Definition at line 1928 of file Config.py.

Member Function Documentation

def Config.TestModuleCommand.setUp (   self)
Nothing to do 

Definition at line 1929 of file Config.py.

1930  def setUp(self):
1931  """Nothing to do """
None
def Config.TestModuleCommand.testCloneSequence (   self)

Definition at line 2738 of file Config.py.

References gpuClustering.id, mps_fire.Path, and str.

2739  def testCloneSequence(self):
2740  p = Process("test")
2741  a = EDAnalyzer("MyAnalyzer")
2742  p.a = a
2743  a.setLabel("a")
2744  b = EDAnalyzer("YOurAnalyzer")
2745  p.b = b
2746  b.setLabel("b")
2747  path = Path(a * b)
2748  p.path = Path(p.a*p.b)
2749  lookuptable = {id(a): p.a, id(b): p.b}
2750  #self.assertEqual(str(path),str(path._postProcessFixup(lookuptable)))
2751  #lookuptable = p._cloneToObjectDict
2752  #self.assertEqual(str(path),str(path._postProcessFixup(lookuptable)))
2753  self.assertEqual(str(path),str(p.path))
tuple Path
Definition: mps_fire.py:298
uint16_t *__restrict__ id
#define str(s)
def Config.TestModuleCommand.testContains (   self)

Definition at line 2754 of file Config.py.

References mps_fire.Path, and cmsswSequenceInfo.Sequence.

2755  def testContains(self):
2756 
2757  a = EDProducer("a")
2758  b = EDProducer("b")
2759  c = EDProducer("c")
2760  d = EDProducer("d")
2761  e = EDProducer("e")
2762  f = EDProducer("f")
2763  g = EDProducer("g")
2764  h = EDProducer("h")
2765  i = EDProducer("i")
2766  j = EDProducer("j")
2767  k = EDProducer("k")
2768  l = EDProducer("l")
2769  m = EDProducer("m")
2770  n = EDProducer("n")
2771 
2772  seq1 = Sequence(e)
2773  task1 = Task(g)
2774  path = Path(a * c * seq1, task1)
2775 
2776  self.assertTrue(path.contains(a))
2777  self.assertFalse(path.contains(b))
2778  self.assertTrue(path.contains(c))
2779  self.assertFalse(path.contains(d))
2780  self.assertTrue(path.contains(e))
2781  self.assertFalse(path.contains(f))
2782  self.assertTrue(path.contains(g))
2783 
2784  endpath = EndPath(h * i)
2785  self.assertFalse(endpath.contains(b))
2786  self.assertTrue(endpath.contains(i))
2787 
2788  seq = Sequence(a * c)
2789  self.assertFalse(seq.contains(b))
2790  self.assertTrue(seq.contains(c))
2791 
2792  task2 = Task(l)
2793  task = Task(j, k, task2)
2794  self.assertFalse(task.contains(b))
2795  self.assertTrue(task.contains(j))
2796  self.assertTrue(task.contains(k))
2797  self.assertTrue(task.contains(l))
2798 
2799  task3 = Task(m)
2800  path2 = Path(n)
2801  sch = Schedule(path, path2, tasks=[task,task3])
2802  self.assertFalse(sch.contains(b))
2803  self.assertTrue(sch.contains(a))
2804  self.assertTrue(sch.contains(c))
2805  self.assertTrue(sch.contains(e))
2806  self.assertTrue(sch.contains(g))
2807  self.assertTrue(sch.contains(n))
2808  self.assertTrue(sch.contains(j))
2809  self.assertTrue(sch.contains(k))
2810  self.assertTrue(sch.contains(l))
2811  self.assertTrue(sch.contains(m))
tuple Path
Definition: mps_fire.py:298
def Config.TestModuleCommand.testDelete (   self)

Definition at line 3394 of file Config.py.

References ConfigBuilder.dumpPython(), mps_fire.Path, and cmsswSequenceInfo.Sequence.

3395  def testDelete(self):
3396  p = Process("test")
3397  p.a = EDAnalyzer("MyAnalyzer")
3398  p.b = EDAnalyzer("YourAnalyzer")
3399  p.c = EDAnalyzer("OurAnalyzer")
3400  p.d = EDAnalyzer("OurAnalyzer")
3401  p.e = EDAnalyzer("OurAnalyzer")
3402  p.f = EDAnalyzer("OurAnalyzer")
3403  p.g = EDProducer("OurProducer")
3404  p.h = EDProducer("YourProducer")
3405  p.t1 = Task(p.g, p.h)
3406  t2 = Task(p.g, p.h)
3407  t3 = Task(p.g, p.h)
3408  p.t4 = Task(p.h)
3409  p.s = Sequence(p.d+p.e)
3410  p.path1 = Path(p.a+p.f+p.s,t2)
3411  p.path2 = Path(p.a)
3412  p.endpath2 = EndPath(p.b)
3413  p.endpath1 = EndPath(p.b+p.f)
3414  p.schedule = Schedule(p.path2, p.endpath2, tasks=[t3, p.t4])
3415  self.assertTrue(hasattr(p, 'f'))
3416  self.assertTrue(hasattr(p, 'g'))
3417  del p.e
3418  del p.f
3419  del p.g
3420  self.assertFalse(hasattr(p, 'f'))
3421  self.assertFalse(hasattr(p, 'g'))
3422  self.assertEqual(p.t1.dumpPython(), 'cms.Task(process.h)\n')
3423  self.assertEqual(p.s.dumpPython(), 'cms.Sequence(process.d)\n')
3424  self.assertEqual(p.path1.dumpPython(), 'cms.Path(process.a+process.s, cms.Task(process.h))\n')
3425  self.assertEqual(p.endpath1.dumpPython(), 'cms.EndPath(process.b)\n')
3426  del p.s
3427  self.assertEqual(p.path1.dumpPython(), 'cms.Path(process.a+(process.d), cms.Task(process.h))\n')
3428  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(*[ process.path2, process.endpath2 ], tasks=[cms.Task(process.h), process.t4])\n')
3429  del p.path2
3430  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(*[ process.endpath2 ], tasks=[cms.Task(process.h), process.t4])\n')
3431  del p.endpath2
3432  self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(tasks=[cms.Task(process.h), process.t4])\n')
3433  del p.t4
self.assertEqual(p.schedule_().dumpPython(), 'cms.Schedule(tasks=[cms.Task(process.h)])\n')
tuple Path
Definition: mps_fire.py:298
def Config.TestModuleCommand.testExamples (   self)

Definition at line 3007 of file Config.py.

References HLT_FULL_cff.InputTag, mps_fire.Path, popcon_last_value_cfg.Source, AlCaHLTBitMon_QueryRunRegistry.string, and Types.untracked.

3008  def testExamples(self):
3009  p = Process("Test")
3010  p.source = Source("PoolSource",fileNames = untracked(string("file:reco.root")))
3011  p.foos = EDProducer("FooProducer")
3012  p.bars = EDProducer("BarProducer", foos=InputTag("foos"))
3013  p.out = OutputModule("PoolOutputModule",fileName=untracked(string("file:foos.root")))
3014  p.bars.foos = 'Foosball'
3015  self.assertEqual(p.bars.foos, InputTag('Foosball'))
3016  p.p = Path(p.foos*p.bars)
3017  p.e = EndPath(p.out)
3018  p.add_(Service("MessageLogger"))
tuple Path
Definition: mps_fire.py:298
tuple untracked
Definition: Types.py:34
def Config.TestModuleCommand.testFinalPath (   self)

Definition at line 2703 of file Config.py.

References str.

2704  def testFinalPath(self):
2705  p = Process("test")
2706  p.a = OutputModule("MyOutputModule")
2707  p.b = OutputModule("YourOutputModule")
2708  p.c = OutputModule("OurOutputModule")
2709  path = FinalPath(p.a)
2710  path *= p.b
2711  path += p.c
2712  self.assertEqual(str(path),'a+b+c')
2713  path = FinalPath(p.a*p.b+p.c)
2714  self.assertEqual(str(path),'a+b+c')
2715  path = FinalPath(p.a+ p.b*p.c)
2716  self.assertEqual(str(path),'a+b+c')
2717  path = FinalPath(p.a*(p.b+p.c))
2718  self.assertEqual(str(path),'a+b+c')
2719  p.es = ESProducer("AnESProducer")
2720  self.assertRaises(TypeError,FinalPath,p.es)
2721 
2722  t = FinalPath()
2723  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.FinalPath()\n')
2724 
2725  t = FinalPath(p.a)
2726  self.assertEqual(t.dumpPython(PrintOptions()), 'cms.FinalPath(process.a)\n')
2727 
2728  self.assertRaises(TypeError, FinalPath, Task())
2729  self.assertRaises(TypeError, FinalPath, p.a, Task())
2730 
2731  p.prod = EDProducer("prodName")
2732  p.t1 = Task(p.prod)
2733  self.assertRaises(TypeError, FinalPath, p.a, p.t1, Task(), p.t1)
2734 
2735  p.t = FinalPath(p.a)
2736  p.a = OutputModule("ReplacedOutputModule")
2737  self.assertEqual(p.t.dumpPython(PrintOptions()), 'cms.FinalPath(process.a)\n')
#define str(s)
def Config.TestModuleCommand.testFreeze (   self)

Definition at line 3039 of file Config.py.

3040  def testFreeze(self):
3041  process = Process("Freeze")
3042  m = EDProducer("M", p=PSet(i = int32(1)))
3043  m.p.i = 2
3044  process.m = m
3045  # should be frozen
3046  #self.assertRaises(ValueError, setattr, m.p, 'i', 3)
3047  #self.assertRaises(ValueError, setattr, m, 'p', PSet(i=int32(1)))
3048  #self.assertRaises(ValueError, setattr, m.p, 'j', 1)
3049  #self.assertRaises(ValueError, setattr, m, 'j', 1)
3050  # But OK to change through the process
3051  process.m.p.i = 4
3052  self.assertEqual(process.m.p.i.value(), 4)
3053  process.m.p = PSet(j=int32(1))
3054  # should work to clone it, though
3055  m2 = m.clone(p = PSet(i = int32(5)), j = int32(8))
3056  m2.p.i = 6
m2.j = 8
def Config.TestModuleCommand.testGlobalReplace (   self)

Definition at line 2365 of file Config.py.

References mps_fire.Path, and cmsswSequenceInfo.Sequence.

2366  def testGlobalReplace(self):
2367  p = Process('test')
2368  p.a = EDAnalyzer("MyAnalyzer")
2369  old = p.a
2370  p.b = EDAnalyzer("YourAnalyzer")
2371  p.c = EDAnalyzer("OurAnalyzer")
2372  p.d = EDProducer("MyProducer")
2373  old2 = p.d
2374  p.t1 = Task(p.d)
2375  t2 = Task(p.d)
2376  t3 = Task(p.d)
2377  t4 = Task(p.d)
2378  t5 = Task(p.d)
2379  t6 = Task(p.d)
2380  s = Sequence(p.a*p.b)
2381  p.s4 = Sequence(p.a*p.b)
2382  s.associate(t2)
2383  p.s4.associate(t2)
2384  p.p = Path(p.c+s+p.a)
2385  p.p2 = Path(p.c+p.s4+p.a)
2386  p.e3 = EndPath(p.c+s+p.a)
2387  new = EDAnalyzer("NewAnalyzer")
2388  new2 = EDProducer("NewProducer")
2389  visitor1 = NodeVisitor()
2390  p.p.visit(visitor1)
2391  self.assertTrue(visitor1.modules == set([old,old2,p.b,p.c]))
2392  p.schedule = Schedule(tasks=[t6])
2393  p.globalReplace("a",new)
2394  p.globalReplace("d",new2)
2395  visitor2 = NodeVisitor()
2396  p.p.visit(visitor2)
2397  self.assertTrue(visitor2.modules == set([new,new2,p.b,p.c]))
2398  self.assertEqual(p.p.dumpPython()[:-1], "cms.Path(process.c+process.a+process.b+process.a, cms.Task(process.d))")
2399  visitor_p2 = NodeVisitor()
2400  p.p2.visit(visitor_p2)
2401  self.assertTrue(visitor_p2.modules == set([new,new2,p.b,p.c]))
2402  self.assertEqual(p.p2.dumpPython()[:-1], "cms.Path(process.c+process.s4+process.a)")
2403  visitor3 = NodeVisitor()
2404  p.e3.visit(visitor3)
2405  self.assertTrue(visitor3.modules == set([new,new2,p.b,p.c]))
2406  visitor4 = NodeVisitor()
2407  p.s4.visit(visitor4)
2408  self.assertTrue(visitor4.modules == set([new,new2,p.b]))
2409  self.assertEqual(p.s4.dumpPython()[:-1],"cms.Sequence(process.a+process.b, cms.Task(process.d))")
2410  visitor5 = NodeVisitor()
2411  p.t1.visit(visitor5)
2412  self.assertTrue(visitor5.modules == set([new2]))
2413  visitor6 = NodeVisitor()
2414  listOfTasks = list(p.schedule._tasks)
2415  listOfTasks[0].visit(visitor6)
2416  self.assertTrue(visitor6.modules == set([new2]))
2417 
2418  p.d2 = EDProducer("YourProducer")
2419  p.schedule = Schedule(p.p, p.p2, p.e3, tasks=[p.t1])
2420  self.assertEqual(p.schedule.dumpPython()[:-1], "cms.Schedule(*[ process.p, process.p2, process.e3 ], tasks=[process.t1])")
2421  p.p = Path(p.c+s)
2422  self.assertEqual(p.schedule.dumpPython()[:-1], "cms.Schedule(*[ process.p, process.p2, process.e3 ], tasks=[process.t1])")
2423  p.e3 = EndPath(p.c)
2424  self.assertEqual(p.schedule.dumpPython()[:-1], "cms.Schedule(*[ process.p, process.p2, process.e3 ], tasks=[process.t1])")
2425  p.t1 = Task(p.d2)
2426  self.assertEqual(p.schedule.dumpPython()[:-1], "cms.Schedule(*[ process.p, process.p2, process.e3 ], tasks=[process.t1])")
tuple Path
Definition: mps_fire.py:298
def Config.TestModuleCommand.testImplicitSchedule (   self)

Definition at line 2917 of file Config.py.

References mps_fire.Path.

2918  def testImplicitSchedule(self):
2919  p = Process("test")
2920  p.a = EDAnalyzer("MyAnalyzer")
2921  p.b = EDAnalyzer("YourAnalyzer")
2922  p.c = EDAnalyzer("OurAnalyzer")
2923  p.path1 = Path(p.a)
2924  p.path2 = Path(p.b)
2925  self.assertTrue(p.schedule is None)
2926  pths = p.paths
2927  keys = pths.keys()
2928  self.assertEqual(pths[keys[0]],p.path1)
2929  self.assertEqual(pths[keys[1]],p.path2)
2930  p.prune()
2931  self.assertTrue(hasattr(p, 'a'))
2932  self.assertTrue(hasattr(p, 'b'))
2933  self.assertTrue(not hasattr(p, 'c'))
2934  self.assertTrue(hasattr(p, 'path1'))
2935  self.assertTrue(hasattr(p, 'path2'))
2936 
2937 
2938  p = Process("test")
2939  p.a = EDAnalyzer("MyAnalyzer")
2940  p.b = EDAnalyzer("YourAnalyzer")
2941  p.c = EDAnalyzer("OurAnalyzer")
2942  p.path2 = Path(p.b)
2943  p.path1 = Path(p.a)
2944  self.assertTrue(p.schedule is None)
2945  pths = p.paths
2946  keys = pths.keys()
2947  self.assertEqual(pths[keys[1]],p.path1)
2948  self.assertEqual(pths[keys[0]],p.path2)
2949 
tuple Path
Definition: mps_fire.py:298
def Config.TestModuleCommand.testMaxEvents (   self)

Definition at line 2992 of file Config.py.

2993  def testMaxEvents(self):
2994  p = Process("Test")
2995  p.maxEvents.input = 10
2996  self.assertEqual(p.maxEvents.input.value(),10)
2997  p = Process("Test")
2998  p.maxEvents.output = 10
2999  self.assertEqual(p.maxEvents.output.value(),10)
3000  p = Process("Test")
3001  p.maxEvents.output = PSet(out=untracked.int32(10))
3002  self.assertEqual(p.maxEvents.output.out.value(), 10)
3003  p = Process("Test")
3004  p.maxEvents = untracked.PSet(input = untracked.int32(5))
3005  self.assertEqual(p.maxEvents.input.value(), 5)
3006 
def Config.TestModuleCommand.testModifier (   self)

Definition at line 3434 of file Config.py.

References submitPVValidationJobs.__init__(), and HistogramManager_cfi.VPSet().

3435  def testModifier(self):
3436  m1 = Modifier()
3437  p = Process("test",m1)
3438  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
3439  def _mod_fred(obj):
3440  obj.fred = 2
3441  m1.toModify(p.a,_mod_fred)
3442  self.assertEqual(p.a.fred.value(),2)
3443  p.b = EDAnalyzer("YourAnalyzer", wilma = int32(1))
3444  m1.toModify(p.b, wilma = 2)
3445  self.assertEqual(p.b.wilma.value(),2)
3446  self.assertTrue(p.isUsingModifier(m1))
3447  #check that Modifier not attached to a process doesn't run
3448  m1 = Modifier()
3449  p = Process("test")
3450  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
3451  m1.toModify(p.a,_mod_fred)
3452  p.b = EDAnalyzer("YourAnalyzer", wilma = int32(1))
3453  m1.toModify(p.b, wilma = 2)
3454  self.assertEqual(p.a.fred.value(),1)
3455  self.assertEqual(p.b.wilma.value(),1)
3456  self.assertEqual(p.isUsingModifier(m1),False)
3457  #make sure clones get the changes
3458  m1 = Modifier()
3459  p = Process("test",m1)
3460  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3461  m1.toModify(p.a, fred = int32(2))
3462  p.b = p.a.clone(wilma = int32(3))
3463  self.assertEqual(p.a.fred.value(),2)
3464  self.assertEqual(p.a.wilma.value(),1)
3465  self.assertEqual(p.b.fred.value(),2)
3466  self.assertEqual(p.b.wilma.value(),3)
3467  #test removal of parameter
3468  m1 = Modifier()
3469  p = Process("test",m1)
3470  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1), fintstones = PSet(fred = int32(1)))
3471  m1.toModify(p.a, fred = None, fintstones = dict(fred = None))
3472  self.assertEqual(hasattr(p.a, "fred"), False)
3473  self.assertEqual(hasattr(p.a.fintstones, "fred"), False)
3474  self.assertEqual(p.a.wilma.value(),1)
3475  #test adding a parameter
3476  m1 = Modifier()
3477  p = Process("test",m1)
3478  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
3479  m1.toModify(p.a, wilma = int32(2))
3480  self.assertEqual(p.a.fred.value(), 1)
3481  self.assertEqual(p.a.wilma.value(),2)
3482  #test setting of value in PSet
3483  m1 = Modifier()
3484  p = Process("test",m1)
3485  p.a = EDAnalyzer("MyAnalyzer", flintstones = PSet(fred = int32(1), wilma = int32(1)))
3486  m1.toModify(p.a, flintstones = dict(fred = int32(2)))
3487  self.assertEqual(p.a.flintstones.fred.value(),2)
3488  self.assertEqual(p.a.flintstones.wilma.value(),1)
3489  #test proper exception from nonexisting parameter name
3490  m1 = Modifier()
3491  p = Process("test",m1)
3492  p.a = EDAnalyzer("MyAnalyzer", flintstones = PSet(fred = PSet(wilma = int32(1))))
3493  self.assertRaises(KeyError, lambda: m1.toModify(p.a, flintstones = dict(imnothere = dict(wilma=2))))
3494  self.assertRaises(KeyError, lambda: m1.toModify(p.a, foo = 1))
3495  #test setting a value in a VPSet
3496  m1 = Modifier()
3497  p = Process("test",m1)
3498  p.a = EDAnalyzer("MyAnalyzer", flintstones = VPSet(PSet(fred = int32(1)), PSet(wilma = int32(1))))
3499  m1.toModify(p.a, flintstones = {1:dict(wilma = int32(2))})
3500  self.assertEqual(p.a.flintstones[0].fred.value(),1)
3501  self.assertEqual(p.a.flintstones[1].wilma.value(),2)
3502  #test setting a value in a list of values
3503  m1 = Modifier()
3504  p = Process("test",m1)
3505  p.a = EDAnalyzer("MyAnalyzer", fred = vuint32(1,2,3))
3506  m1.toModify(p.a, fred = {1:7})
3507  self.assertEqual(p.a.fred[0],1)
3508  self.assertEqual(p.a.fred[1],7)
3509  self.assertEqual(p.a.fred[2],3)
3510  #test IndexError setting a value in a list to an item key not in the list
3511  m1 = Modifier()
3512  p = Process("test",m1)
3513  p.a = EDAnalyzer("MyAnalyzer", fred = vuint32(1,2,3))
3514  raised = False
3515  try: m1.toModify(p.a, fred = {5:7})
3516  except IndexError as e: raised = True
3517  self.assertEqual(raised, True)
3518  #test TypeError setting a value in a list using a key that is not an int
3519  m1 = Modifier()
3520  p = Process("test",m1)
3521  p.a = EDAnalyzer("MyAnalyzer", flintstones = VPSet(PSet(fred = int32(1)), PSet(wilma = int32(1))))
3522  raised = False
3523  try: m1.toModify(p.a, flintstones = dict(bogus = int32(37)))
3524  except TypeError as e: raised = True
3525  self.assertEqual(raised, True)
3526  #test that load causes process wide methods to run
3527  def _rem_a(proc):
3528  del proc.a
3529  class ProcModifierMod(object):
3530  def __init__(self,modifier,func):
3531  self.proc_mod_ = modifier.makeProcessModifier(func)
3532  class DummyMod(object):
3533  def __init__(self):
3534  self.a = EDAnalyzer("Dummy")
3535  testMod = DummyMod()
3536  p.extend(testMod)
3537  self.assertTrue(hasattr(p,"a"))
3538  m1 = Modifier()
3539  p = Process("test",m1)
3540  testProcMod = ProcModifierMod(m1,_rem_a)
3541  p.extend(testMod)
3542  p.extend(testProcMod)
3543  self.assertTrue(not hasattr(p,"a"))
3544  #test ModifierChain
3545  m1 = Modifier()
3546  mc = ModifierChain(m1)
3547  p = Process("test",mc)
3548  self.assertTrue(p.isUsingModifier(m1))
3549  self.assertTrue(p.isUsingModifier(mc))
3550  testMod = DummyMod()
3551  p.b = EDAnalyzer("Dummy2", fred = int32(1))
3552  m1.toModify(p.b, fred = int32(3))
3553  p.extend(testMod)
3554  testProcMod = ProcModifierMod(m1,_rem_a)
3555  p.extend(testProcMod)
3556  self.assertTrue(not hasattr(p,"a"))
3557  self.assertEqual(p.b.fred.value(),3)
3558  #check cloneAndExclude
3559  m1 = Modifier()
3560  m2 = Modifier()
3561  mc = ModifierChain(m1,m2)
3562  mclone = mc.copyAndExclude([m2])
3563  self.assertTrue(not mclone._isOrContains(m2))
3564  self.assertTrue(mclone._isOrContains(m1))
3565  m3 = Modifier()
3566  mc2 = ModifierChain(mc,m3)
3567  mclone = mc2.copyAndExclude([m2])
3568  self.assertTrue(not mclone._isOrContains(m2))
3569  self.assertTrue(mclone._isOrContains(m1))
3570  self.assertTrue(mclone._isOrContains(m3))
3571  #check combining
3572  m1 = Modifier()
3573  m2 = Modifier()
3574  p = Process("test",m1)
3575  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3576  (m1 & m2).toModify(p.a, fred = int32(2))
3577  self.assertRaises(TypeError, lambda: (m1 & m2).toModify(p.a, 1, wilma=2))
3578  self.assertEqual(p.a.fred, 1)
3579  m1 = Modifier()
3580  m2 = Modifier()
3581  p = Process("test",m1,m2)
3582  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3583  (m1 & m2).toModify(p.a, fred = int32(2))
3584  self.assertEqual(p.a.fred, 2)
3585  m1 = Modifier()
3586  m2 = Modifier()
3587  m3 = Modifier()
3588  p = Process("test",m1,m2,m3)
3589  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3590  (m1 & m2 & m3).toModify(p.a, fred = int32(2))
3591  self.assertEqual(p.a.fred, 2)
3592  (m1 & (m2 & m3)).toModify(p.a, fred = int32(3))
3593  self.assertEqual(p.a.fred, 3)
3594  ((m1 & m2) & m3).toModify(p.a, fred = int32(4))
3595  self.assertEqual(p.a.fred, 4)
3596  #check inverse
3597  m1 = Modifier()
3598  m2 = Modifier()
3599  p = Process("test", m1)
3600  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3601  (~m1).toModify(p.a, fred=2)
3602  self.assertEqual(p.a.fred, 1)
3603  (~m2).toModify(p.a, wilma=2)
3604  self.assertEqual(p.a.wilma, 2)
3605  self.assertRaises(TypeError, lambda: (~m1).toModify(p.a, 1, wilma=2))
3606  self.assertRaises(TypeError, lambda: (~m2).toModify(p.a, 1, wilma=2))
3607  # check or
3608  m1 = Modifier()
3609  m2 = Modifier()
3610  m3 = Modifier()
3611  p = Process("test", m1)
3612  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3613  (m1 | m2).toModify(p.a, fred=2)
3614  self.assertEqual(p.a.fred, 2)
3615  (m1 | m2 | m3).toModify(p.a, fred=3)
3616  self.assertEqual(p.a.fred, 3)
3617  (m3 | m2 | m1).toModify(p.a, fred=4)
3618  self.assertEqual(p.a.fred, 4)
3619  ((m1 | m2) | m3).toModify(p.a, fred=5)
3620  self.assertEqual(p.a.fred, 5)
3621  (m1 | (m2 | m3)).toModify(p.a, fred=6)
3622  self.assertEqual(p.a.fred, 6)
3623  (m2 | m3).toModify(p.a, fred=7)
3624  self.assertEqual(p.a.fred, 6)
3625  self.assertRaises(TypeError, lambda: (m1 | m2).toModify(p.a, 1, wilma=2))
3626  self.assertRaises(TypeError, lambda: (m2 | m3).toModify(p.a, 1, wilma=2))
3627  # check combinations
3628  m1 = Modifier()
3629  m2 = Modifier()
3630  m3 = Modifier()
3631  m4 = Modifier()
3632  p = Process("test", m1, m2)
3633  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3634  (m1 & ~m2).toModify(p.a, fred=2)
3635  self.assertEqual(p.a.fred, 1)
3636  (m1 & ~m3).toModify(p.a, fred=2)
3637  self.assertEqual(p.a.fred, 2)
3638  (m1 | ~m2).toModify(p.a, fred=3)
3639  self.assertEqual(p.a.fred, 3)
3640  (~m1 | ~m2).toModify(p.a, fred=4)
3641  self.assertEqual(p.a.fred, 3)
3642  (~m3 & ~m4).toModify(p.a, fred=4)
3643  self.assertEqual(p.a.fred, 4)
3644  ((m1 & m3) | ~m4).toModify(p.a, fred=5)
3645  self.assertEqual(p.a.fred, 5)
3646  #check toReplaceWith
3647  m1 = Modifier()
3648  p = Process("test",m1)
3649  p.a =EDAnalyzer("MyAnalyzer", fred = int32(1))
3650  m1.toReplaceWith(p.a, EDAnalyzer("YourAnalyzer", wilma = int32(3)))
3651  self.assertRaises(TypeError, lambda: m1.toReplaceWith(p.a, EDProducer("YourProducer")))
3652  p.b =EDAnalyzer("BAn")
3653  p.c =EDProducer("c")
3654  p.d =EDProducer("d")
3655  p.tc = Task(p.c)
3656  p.td = Task(p.d)
3657  p.s = Sequence(p.a, p.tc)
3658  m1.toReplaceWith(p.s, Sequence(p.a+p.b, p.td))
3659  self.assertEqual(p.a.wilma.value(),3)
3660  self.assertEqual(p.a.type_(),"YourAnalyzer")
3661  self.assertEqual(hasattr(p,"fred"),False)
3662  self.assertTrue(p.s.dumpPython() == "cms.Sequence(process.a+process.b, process.td)\n")
3663  p.e =EDProducer("e")
3664  m1.toReplaceWith(p.td, Task(p.e))
3665  self.assertTrue(p.td._collection == OrderedSet([p.e]))
3666  #check toReplaceWith doesn't activate not chosen
3667  m1 = Modifier()
3668  p = Process("test")
3669  p.a =EDAnalyzer("MyAnalyzer", fred = int32(1))
3670  m1.toReplaceWith(p.a, EDAnalyzer("YourAnalyzer", wilma = int32(3)))
3671  self.assertEqual(p.a.type_(),"MyAnalyzer")
3672  #check toReplaceWith and and/not/or combinations
3673  m1 = Modifier()
3674  m2 = Modifier()
3675  m3 = Modifier()
3676  m4 = Modifier()
3677  p = Process("test", m1, m2)
3678  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3679  self.assertRaises(TypeError, lambda: (m1 & m2).toReplaceWith(p.a, EDProducer("YourProducer")))
3680  self.assertRaises(TypeError, lambda: (m3 & m4).toReplaceWith(p.a, EDProducer("YourProducer")))
3681  self.assertRaises(TypeError, lambda: (~m3).toReplaceWith(p.a, EDProducer("YourProducer")))
3682  self.assertRaises(TypeError, lambda: (~m1).toReplaceWith(p.a, EDProducer("YourProducer")))
3683  self.assertRaises(TypeError, lambda: (m1 | m3).toReplaceWith(p.a, EDProducer("YourProducer")))
3684  self.assertRaises(TypeError, lambda: (m3 | m4).toReplaceWith(p.a, EDProducer("YourProducer")))
3685  (m1 & m2).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer1"))
3686  self.assertEqual(p.a.type_(), "YourAnalyzer1")
3687  (m1 & m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
3688  self.assertEqual(p.a.type_(), "YourAnalyzer1")
3689  (~m1).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
3690  self.assertEqual(p.a.type_(), "YourAnalyzer1")
3691  (~m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
3692  self.assertEqual(p.a.type_(), "YourAnalyzer2")
3693  (m1 | m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer3"))
3694  self.assertEqual(p.a.type_(), "YourAnalyzer3")
3695  (m3 | m4).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer4"))
3696  self.assertEqual(p.a.type_(), "YourAnalyzer3")
3697 
3698  # EDAlias
3699  a = EDAlias(foo2 = VPSet(PSet(type = string("Foo2"))))
3700  m = Modifier()
3701  m._setChosen()
3702  # Modify parameters
3703  m.toModify(a, foo2 = {0: dict(type = "Foo3")})
3704  self.assertEqual(a.foo2[0].type, "Foo3")
3705  # Add an alias
3706  m.toModify(a, foo4 = VPSet(PSet(type = string("Foo4"))))
3707  self.assertEqual(a.foo2[0].type, "Foo3")
3708  self.assertEqual(a.foo4[0].type, "Foo4")
3709  # Remove an alias
3710  m.toModify(a, foo2 = None)
3711  self.assertFalse(hasattr(a, "foo2"))
3712  self.assertEqual(a.foo4[0].type, "Foo4")
3713  # Replace (doesn't work out of the box because EDAlias is not _Parameterizable
3714  m.toReplaceWith(a, EDAlias(bar = VPSet(PSet(type = string("Bar")))))
3715  self.assertFalse(hasattr(a, "foo2"))
3716  self.assertFalse(hasattr(a, "foo4"))
3717  self.assertTrue(hasattr(a, "bar"))
3718  self.assertEqual(a.bar[0].type, "Bar")
3719 
3720  # SwitchProducer
3721  sp = SwitchProducerTest(test1 = EDProducer("Foo",
3722  a = int32(1),
3723  b = PSet(c = int32(2))),
3724  test2 = EDProducer("Bar",
3725  aa = int32(11),
3726  bb = PSet(cc = int32(12))))
3727  m = Modifier()
3728  m._setChosen()
3729  # Modify parameters
3730  m.toModify(sp,
3731  test1 = dict(a = 4, b = dict(c = None)),
3732  test2 = dict(aa = 15, bb = dict(cc = 45, dd = string("foo"))))
3733  self.assertEqual(sp.test1.a.value(), 4)
3734  self.assertEqual(sp.test1.b.hasParameter("c"), False)
3735  self.assertEqual(sp.test2.aa.value(), 15)
3736  self.assertEqual(sp.test2.bb.cc.value(), 45)
3737  self.assertEqual(sp.test2.bb.dd.value(), "foo")
3738  # Replace a producer
3739  m.toReplaceWith(sp.test1, EDProducer("Fred", x = int32(42)))
3740  self.assertEqual(sp.test1.type_(), "Fred")
3741  self.assertEqual(sp.test1.x.value(), 42)
3742  self.assertRaises(TypeError, lambda: m.toReplaceWith(sp.test1, EDAnalyzer("Foo")))
3743  # Alternative way (only to be allow same syntax to be used as for adding)
3744  m.toModify(sp, test2 = EDProducer("Xyzzy", x = int32(24)))
3745  self.assertEqual(sp.test2.type_(), "Xyzzy")
3746  self.assertEqual(sp.test2.x.value(), 24)
3747  self.assertRaises(TypeError, lambda: m.toModify(sp, test2 = EDAnalyzer("Foo")))
3748  # Add a producer
3749  m.toModify(sp, test3 = EDProducer("Wilma", y = int32(24)))
3750  self.assertEqual(sp.test3.type_(), "Wilma")
3751  self.assertEqual(sp.test3.y.value(), 24)
3752  self.assertRaises(TypeError, lambda: m.toModify(sp, test4 = EDAnalyzer("Foo")))
3753  # Remove a producer
3754  m.toModify(sp, test2 = None)
3755  self.assertEqual(hasattr(sp, "test2"), False)
3756  # Add an alias
3757  m.toModify(sp, test2 = EDAlias(foo = VPSet(PSet(type = string("int")))))
3758  self.assertTrue(hasattr(sp.test2, "foo"))
3759  # Replace an alias
3760  m.toReplaceWith(sp.test2, EDAlias(bar = VPSet(PSet(type = string("int")))))
3761  self.assertTrue(hasattr(sp.test2, "bar"))
3762  # Alternative way
3763  m.toModify(sp, test2 = EDAlias(xyzzy = VPSet(PSet(type = string("int")))))
3764  self.assertTrue(hasattr(sp.test2, "xyzzy"))
3765  # Replace an alias with EDProducer
3766  self.assertRaises(TypeError, lambda: m.toReplaceWith(sp.test2, EDProducer("Foo")))
m.toModify(sp, test2 = EDProducer("Foo"))
def Config.TestModuleCommand.testOptions (   self)

Definition at line 2980 of file Config.py.

2981  def testOptions(self):
2982  p = Process('test')
2983  self.assertEqual(p.options.numberOfThreads.value(),1)
2984  p.options.numberOfThreads = 8
2985  self.assertEqual(p.options.numberOfThreads.value(),8)
2986  p.options = PSet()
2987  self.assertEqual(p.options.numberOfThreads.value(),1)
2988  p.options = dict(numberOfStreams =2,
2989  numberOfThreads =2)
2990  self.assertEqual(p.options.numberOfThreads.value(),2)
2991  self.assertEqual(p.options.numberOfStreams.value(),2)
def Config.TestModuleCommand.testOverride (   self)

Definition at line 2957 of file Config.py.

2958  def testOverride(self):
2959  p = Process('test')
2960  a = EDProducer("A", a1=int32(0))
2961  self.assertTrue(not a.isModified())
2962  a.a1 = 1
2963  self.assertTrue(a.isModified())
2964  p.a = a
2965  self.assertEqual(p.a.a1.value(), 1)
2966  # try adding an unmodified module.
2967  # should accept it
2968  p.a = EDProducer("A", a1=int32(2))
2969  self.assertEqual(p.a.a1.value(), 2)
2970  # try adding a modified module. Should throw
2971  # no longer, since the same (modified) say, geometry
2972  # could come from more than one cff
2973  b = EDProducer("A", a1=int32(3))
2974  b.a1 = 4
2975  #self.assertRaises(RuntimeError, setattr, *(p,'a',b))
2976  ps1 = PSet(a = int32(1))
2977  ps2 = PSet(a = int32(2))
2978  self.assertRaises(ValueError, EDProducer, 'C', ps1, ps2)
2979  self.assertRaises(ValueError, EDProducer, 'C', ps1, a=int32(3))
def Config.TestModuleCommand.testParameterizable (   self)

Definition at line 1932 of file Config.py.

1933  def testParameterizable(self):
1934  p = _Parameterizable()
1935  self.assertEqual(len(p.parameterNames_()),0)
1936  p.a = int32(1)
1937  self.assertTrue('a' in p.parameterNames_())
1938  self.assertEqual(p.a.value(), 1)
1939  p.a = 10
1940  self.assertEqual(p.a.value(), 10)
1941  p.a = untracked(int32(1))
1942  self.assertEqual(p.a.value(), 1)
1943  self.assertFalse(p.a.isTracked())
1944  p.a = untracked.int32(1)
1945  self.assertEqual(p.a.value(), 1)
1946  self.assertFalse(p.a.isTracked())
1947  p = _Parameterizable(foo=int32(10), bar = untracked(double(1.0)))
1948  self.assertEqual(p.foo.value(), 10)
1949  self.assertEqual(p.bar.value(),1.0)
1950  self.assertFalse(p.bar.isTracked())
1951  self.assertRaises(TypeError,setattr,(p,'c',1))
1952  p = _Parameterizable(a=PSet(foo=int32(10), bar = untracked(double(1.0))))
1953  self.assertEqual(p.a.foo.value(),10)
1954  self.assertEqual(p.a.bar.value(),1.0)
1955  p.b = untracked(PSet(fii = int32(1)))
1956  self.assertEqual(p.b.fii.value(),1)
1957  self.assertFalse(p.b.isTracked())
1958  #test the fact that values can be shared
1959  v = int32(10)
1960  p=_Parameterizable(a=v)
1961  v.setValue(11)
1962  self.assertEqual(p.a.value(),11)
1963  p.a = 12
1964  self.assertEqual(p.a.value(),12)
self.assertEqual(v.value(),12)
tuple untracked
Definition: Types.py:34
def Config.TestModuleCommand.testPath (   self)

Definition at line 2663 of file Config.py.

References SequenceTypes.ignore(), mps_fire.Path, and str.

2664  def testPath(self):
2665  p = Process("test")
2666  p.a = EDAnalyzer("MyAnalyzer")
2667  p.b = EDAnalyzer("YourAnalyzer")
2668  p.c = EDAnalyzer("OurAnalyzer")
2669  path = Path(p.a)
2670  path *= p.b
2671  path += p.c
2672  self.assertEqual(str(path),'a+b+c')
2673  path = Path(p.a*p.b+p.c)
2674  self.assertEqual(str(path),'a+b+c')
2675 # path = Path(p.a)*p.b+p.c #This leads to problems with sequences
2676 # self.assertEqual(str(path),'((a*b)+c)')
2677  path = Path(p.a+ p.b*p.c)
2678  self.assertEqual(str(path),'a+b+c')
2679  path = Path(p.a*(p.b+p.c))
2680  self.assertEqual(str(path),'a+b+c')
2681  path = Path(p.a*(p.b+~p.c))
2682  pathx = Path(p.a*(p.b+ignore(p.c)))
2683  self.assertEqual(str(path),'a+b+~c')
2684  p.es = ESProducer("AnESProducer")
2685  self.assertRaises(TypeError,Path,p.es)
2686 
2687  t = Path()
2688  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path()\n')
2689 
2690  t = Path(p.a)
2691  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path(process.a)\n')
2692 
2693  t = Path(Task())
2694  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path(cms.Task())\n')
2695 
2696  t = Path(p.a, Task())
2697  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path(process.a, cms.Task())\n')
2698 
2699  p.prod = EDProducer("prodName")
2700  p.t1 = Task(p.prod)
2701  t = Path(p.a, p.t1, Task(), p.t1)
2702  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path(process.a, cms.Task(), process.t1)\n')
tuple Path
Definition: mps_fire.py:298
#define str(s)
def Config.TestModuleCommand.testPrefers (   self)

Definition at line 3019 of file Config.py.

References Config._lineDiff(), and ConfigBuilder.dumpPython().

3020  def testPrefers(self):
3021  p = Process("Test")
3022  p.add_(ESSource("ForceSource"))
3023  p.juicer = ESProducer("JuicerProducer")
3024  p.prefer("ForceSource")
3025  p.prefer("juicer")
3026  self.assertEqual(_lineDiff(p.dumpPython(), Process('Test').dumpPython()),
3027 """process.juicer = cms.ESProducer("JuicerProducer")
3028 process.ForceSource = cms.ESSource("ForceSource")
3029 process.prefer("ForceSource")
3030 process.prefer("juicer")""")
3031  p.prefer("juicer",fooRcd=vstring("Foo"))
3032  self.assertEqual(_lineDiff(p.dumpPython(), Process('Test').dumpPython()),
3033 """process.juicer = cms.ESProducer("JuicerProducer")
3034 process.ForceSource = cms.ESSource("ForceSource")
3035 process.prefer("ForceSource")
3036 process.prefer("juicer",
3037  fooRcd = cms.vstring('Foo')
3038 )""")
def _lineDiff
Definition: Config.py:1831
def Config.TestModuleCommand.testProcessDumpPython (   self)

Definition at line 2084 of file Config.py.

References Config._lineDiff(), ConfigBuilder.dumpPython(), mps_fire.Path, and cmsswSequenceInfo.Sequence.

2085  def testProcessDumpPython(self):
2086  self.assertEqual(Process("test").dumpPython(),
2087 """import FWCore.ParameterSet.Config as cms
2088 
2089 process = cms.Process("test")
2090 
2091 process.maxEvents = cms.untracked.PSet(
2092  input = cms.optional.untracked.int32,
2093  output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
2094 )
2095 
2096 process.maxLuminosityBlocks = cms.untracked.PSet(
2097  input = cms.untracked.int32(-1)
2098 )
2099 
2100 process.options = cms.untracked.PSet(
2101  FailPath = cms.untracked.vstring(),
2102  IgnoreCompletely = cms.untracked.vstring(),
2103  Rethrow = cms.untracked.vstring(),
2104  SkipEvent = cms.untracked.vstring(),
2105  allowUnscheduled = cms.obsolete.untracked.bool,
2106  canDeleteEarly = cms.untracked.vstring(),
2107  deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
2108  dumpOptions = cms.untracked.bool(False),
2109  emptyRunLumiMode = cms.obsolete.untracked.string,
2110  eventSetup = cms.untracked.PSet(
2111  forceNumberOfConcurrentIOVs = cms.untracked.PSet(
2112  allowAnyLabel_=cms.required.untracked.uint32
2113  ),
2114  numberOfConcurrentIOVs = cms.untracked.uint32(0)
2115  ),
2116  fileMode = cms.untracked.string('FULLMERGE'),
2117  forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
2118  makeTriggerResults = cms.obsolete.untracked.bool,
2119  numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
2120  numberOfConcurrentRuns = cms.untracked.uint32(1),
2121  numberOfStreams = cms.untracked.uint32(0),
2122  numberOfThreads = cms.untracked.uint32(1),
2123  printDependencies = cms.untracked.bool(False),
2124  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
2125  throwIfIllegalParameter = cms.untracked.bool(True),
2126  wantSummary = cms.untracked.bool(False)
2127 )
2128 
2129 process.MessageLogger = cms.Service("MessageLogger",
2130  cerr = cms.untracked.PSet(
2131  FwkReport = cms.untracked.PSet(
2132  limit = cms.untracked.int32(10000000),
2133  reportEvery = cms.untracked.int32(1)
2134  ),
2135  FwkSummary = cms.untracked.PSet(
2136  limit = cms.untracked.int32(10000000),
2137  reportEvery = cms.untracked.int32(1)
2138  ),
2139  INFO = cms.untracked.PSet(
2140  limit = cms.untracked.int32(0)
2141  ),
2142  Root_NoDictionary = cms.untracked.PSet(
2143  limit = cms.untracked.int32(0)
2144  ),
2145  default = cms.untracked.PSet(
2146  limit = cms.untracked.int32(10000000)
2147  ),
2148  enable = cms.untracked.bool(True),
2149  enableStatistics = cms.untracked.bool(True),
2150  lineLength = cms.optional.untracked.int32,
2151  noLineBreaks = cms.optional.untracked.bool,
2152  noTimeStamps = cms.untracked.bool(False),
2153  resetStatistics = cms.untracked.bool(False),
2154  statisticsThreshold = cms.untracked.string('WARNING'),
2155  threshold = cms.untracked.string('INFO'),
2156  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2157  limit = cms.optional.untracked.int32,
2158  reportEvery = cms.untracked.int32(1),
2159  timespan = cms.optional.untracked.int32
2160  )
2161  ),
2162  cout = cms.untracked.PSet(
2163  enable = cms.untracked.bool(False),
2164  enableStatistics = cms.untracked.bool(False),
2165  lineLength = cms.optional.untracked.int32,
2166  noLineBreaks = cms.optional.untracked.bool,
2167  noTimeStamps = cms.optional.untracked.bool,
2168  resetStatistics = cms.untracked.bool(False),
2169  statisticsThreshold = cms.optional.untracked.string,
2170  threshold = cms.optional.untracked.string,
2171  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2172  limit = cms.optional.untracked.int32,
2173  reportEvery = cms.untracked.int32(1),
2174  timespan = cms.optional.untracked.int32
2175  )
2176  ),
2177  debugModules = cms.untracked.vstring(),
2178  default = cms.untracked.PSet(
2179  limit = cms.optional.untracked.int32,
2180  lineLength = cms.untracked.int32(80),
2181  noLineBreaks = cms.untracked.bool(False),
2182  noTimeStamps = cms.untracked.bool(False),
2183  reportEvery = cms.untracked.int32(1),
2184  statisticsThreshold = cms.untracked.string('INFO'),
2185  threshold = cms.untracked.string('INFO'),
2186  timespan = cms.optional.untracked.int32,
2187  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2188  limit = cms.optional.untracked.int32,
2189  reportEvery = cms.untracked.int32(1),
2190  timespan = cms.optional.untracked.int32
2191  )
2192  ),
2193  files = cms.untracked.PSet(
2194  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2195  enableStatistics = cms.untracked.bool(False),
2196  extension = cms.optional.untracked.string,
2197  filename = cms.optional.untracked.string,
2198  lineLength = cms.optional.untracked.int32,
2199  noLineBreaks = cms.optional.untracked.bool,
2200  noTimeStamps = cms.optional.untracked.bool,
2201  output = cms.optional.untracked.string,
2202  resetStatistics = cms.untracked.bool(False),
2203  statisticsThreshold = cms.optional.untracked.string,
2204  threshold = cms.optional.untracked.string,
2205  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2206  limit = cms.optional.untracked.int32,
2207  reportEvery = cms.untracked.int32(1),
2208  timespan = cms.optional.untracked.int32
2209  )
2210  )
2211  ),
2212  suppressDebug = cms.untracked.vstring(),
2213  suppressFwkInfo = cms.untracked.vstring(),
2214  suppressInfo = cms.untracked.vstring(),
2215  suppressWarning = cms.untracked.vstring(),
2216  allowAnyLabel_=cms.optional.untracked.PSetTemplate(
2217  limit = cms.optional.untracked.int32,
2218  reportEvery = cms.untracked.int32(1),
2219  timespan = cms.optional.untracked.int32
2220  )
2221 )
2222 
2223 
2224 """)
2225  p = Process("test")
2226  p.a = EDAnalyzer("MyAnalyzer")
2227  p.p = Path(p.a)
2228  p.s = Sequence(p.a)
2229  p.r = Sequence(p.s)
2230  p.p2 = Path(p.s)
2231  p.schedule = Schedule(p.p2,p.p)
2232  d=p.dumpPython()
2233  self.assertEqual(_lineDiff(d,Process("test").dumpPython()),
2234 """process.a = cms.EDAnalyzer("MyAnalyzer")
2235 process.s = cms.Sequence(process.a)
2236 process.r = cms.Sequence(process.s)
2237 process.p = cms.Path(process.a)
2238 process.p2 = cms.Path(process.s)
2239 process.schedule = cms.Schedule(*[ process.p2, process.p ])""")
2240  #Reverse order of 'r' and 's'
2241  p = Process("test")
2242  p.a = EDAnalyzer("MyAnalyzer")
2243  p.p = Path(p.a)
2244  p.r = Sequence(p.a)
2245  p.s = Sequence(p.r)
2246  p.p2 = Path(p.r)
2247  p.schedule = Schedule(p.p2,p.p)
2248  p.b = EDAnalyzer("YourAnalyzer")
2249  d=p.dumpPython()
2250  self.assertEqual(_lineDiff(d,Process("test").dumpPython()),
2251 """process.a = cms.EDAnalyzer("MyAnalyzer")
2252 process.b = cms.EDAnalyzer("YourAnalyzer")
2253 process.r = cms.Sequence(process.a)
2254 process.s = cms.Sequence(process.r)
2255 process.p = cms.Path(process.a)
2256 process.p2 = cms.Path(process.r)
process.schedule = cms.Schedule(*[ process.p2, process.p ])""")
tuple Path
Definition: mps_fire.py:298
def _lineDiff
Definition: Config.py:1831
def Config.TestModuleCommand.testProcessExtend (   self)

Definition at line 1997 of file Config.py.

References submitPVValidationJobs.__init__(), mps_fire.Path, cmsswSequenceInfo.Sequence, and str.

1998  def testProcessExtend(self):
1999  class FromArg(object):
2000  def __init__(self,*arg,**args):
2001  for name in args.keys():
2002  self.__dict__[name]=args[name]
2003 
2004  a=EDAnalyzer("MyAnalyzer")
2005  t=EDAnalyzer("MyAnalyzer")
2006  t.setLabel("foo")
2007  s1 = Sequence(a)
2008  s2 = Sequence(s1)
2009  s3 = Sequence(s2)
2010  d = FromArg(
2011  a=a,
2012  b=Service("Full"),
2013  c=Path(a),
2014  d=s2,
2015  e=s1,
2016  f=s3,
2017  g=Sequence(s1+s2+s3)
2018  )
2019  p = Process("Test")
2020  p.extend(d)
2021  self.assertEqual(p.a.type_(),"MyAnalyzer")
2022  self.assertEqual(p.a.label_(),"a")
2023  self.assertRaises(AttributeError,getattr,p,'b')
2024  self.assertEqual(p.Full.type_(),"Full")
2025  self.assertEqual(str(p.c),'a')
2026  self.assertEqual(str(p.d),'a')
2027 
2028  z1 = FromArg(
2029  a=a,
2030  b=Service("Full"),
2031  c=Path(a),
2032  d=s2,
2033  e=s1,
2034  f=s3,
2035  s4=s3,
2036  g=Sequence(s1+s2+s3)
2037  )
2038 
2039  p1 = Process("Test")
2040  #p1.extend(z1)
2041  self.assertRaises(ValueError, p1.extend, z1)
2042 
2043  z2 = FromArg(
2044  a=a,
2045  b=Service("Full"),
2046  c=Path(a),
2047  d=s2,
2048  e=s1,
2049  f=s3,
2050  aaa=copy.deepcopy(a),
2051  s4=copy.deepcopy(s3),
2052  g=Sequence(s1+s2+s3),
2053  t=t
2054  )
2055  p2 = Process("Test")
2056  p2.extend(z2)
2057  #self.assertRaises(ValueError, p2.extend, z2)
2058  self.assertEqual(p2.s4.label_(),"s4")
2059  #p2.s4.setLabel("foo")
2060  self.assertRaises(ValueError, p2.s4.setLabel, "foo")
2061  p2.s4.setLabel("s4")
2062  p2.s4.setLabel(None)
2063  p2.s4.setLabel("foo")
2064  p2._Process__setObjectLabel(p2.s4, "foo")
2065  p2._Process__setObjectLabel(p2.s4, None)
2066  p2._Process__setObjectLabel(p2.s4, "bar")
2067 
2068 
2069  p = Process('test')
2070  p.a = EDProducer("MyProducer")
2071  p.t = Task(p.a)
2072  p.p = Path(p.t)
2073  self.assertRaises(ValueError, p.extend, FromArg(a = EDProducer("YourProducer")))
2074  self.assertRaises(ValueError, p.extend, FromArg(a = EDAlias()))
2075  self.assertRaises(ValueError, p.__setattr__, "a", EDAlias())
2076 
2077  p = Process('test')
2078  p.a = EDProducer("MyProducer")
2079  p.s = Sequence(p.a)
2080  p.p = Path(p.s)
2081  self.assertRaises(ValueError, p.extend, FromArg(a = EDProducer("YourProducer")))
2082  self.assertRaises(ValueError, p.extend, FromArg(a = EDAlias()))
2083  self.assertRaises(ValueError, p.__setattr__, "a", EDAlias())
tuple Path
Definition: mps_fire.py:298
#define str(s)
def Config.TestModuleCommand.testProcessFragment (   self)

Definition at line 3767 of file Config.py.

3768  def testProcessFragment(self):
3769  #check defaults are not overwritten
3770  f = ProcessFragment('Fragment')
3771  p = Process('PROCESS')
3772  p.maxEvents.input = 10
3773  p.options.numberOfThreads = 4
3774  p.maxLuminosityBlocks.input = 2
3775  p.extend(f)
3776  self.assertEqual(p.maxEvents.input.value(),10)
3777  self.assertEqual(p.options.numberOfThreads.value(), 4)
3778  self.assertEqual(p.maxLuminosityBlocks.input.value(),2)
3779  #general checks
3780  f = ProcessFragment("Fragment")
3781  f.fltr = EDFilter("Foo")
3782  p = Process('PROCESS')
3783  p.extend(f)
3784  self.assertTrue(hasattr(p,'fltr'))
3785 
unittest.main()
def Config.TestModuleCommand.testProcessInsertion (   self)

Definition at line 1972 of file Config.py.

References popcon_last_value_cfg.Source, AlCaHLTBitMon_QueryRunRegistry.string, and HistogramManager_cfi.VPSet().

1973  def testProcessInsertion(self):
1974  p = Process("test")
1975  p.a = EDAnalyzer("MyAnalyzer")
1976  self.assertTrue( 'a' in p.analyzers_() )
1977  self.assertTrue( 'a' in p.analyzers)
1978  p.add_(Service("SomeService"))
1979  self.assertTrue('SomeService' in p.services_())
1980  self.assertEqual(p.SomeService.type_(), "SomeService")
1981  p.Tracer = Service("Tracer")
1982  self.assertTrue('Tracer' in p.services_())
1983  self.assertRaises(TypeError, setattr, *(p,'b',"this should fail"))
1984  self.assertRaises(TypeError, setattr, *(p,'bad',Service("MessageLogger")))
1985  self.assertRaises(ValueError, setattr, *(p,'bad',Source("PoolSource")))
1986  p.out = OutputModule("Outer")
1987  self.assertEqual(p.out.type_(), 'Outer')
1988  self.assertTrue( 'out' in p.outputModules_() )
1989 
1990  p.geom = ESSource("GeomProd")
1991  self.assertTrue('geom' in p.es_sources_())
1992  p.add_(ESSource("ConfigDB"))
1993  self.assertTrue('ConfigDB' in p.es_sources_())
1994 
1995  p.aliasfoo1 = EDAlias(foo1 = VPSet(PSet(type = string("Foo1"))))
1996  self.assertTrue('aliasfoo1' in p.aliases_())
def Config.TestModuleCommand.testPrune (   self)

Definition at line 3192 of file Config.py.

References mps_fire.Path, cmsswSequenceInfo.Sequence, AlCaHLTBitMon_QueryRunRegistry.string, and HistogramManager_cfi.VPSet().

3193  def testPrune(self):
3194  p = Process("test")
3195  p.a = EDAnalyzer("MyAnalyzer")
3196  p.b = EDAnalyzer("YourAnalyzer")
3197  p.c = EDAnalyzer("OurAnalyzer")
3198  p.d = EDAnalyzer("OurAnalyzer")
3199  p.e = EDProducer("MyProducer")
3200  p.f = EDProducer("YourProducer")
3201  p.g = EDProducer("TheirProducer")
3202  p.s = Sequence(p.d)
3203  p.t1 = Task(p.e)
3204  p.t2 = Task(p.f)
3205  p.t3 = Task(p.g, p.t1)
3206  p.path1 = Path(p.a, p.t3)
3207  p.path2 = Path(p.b)
3208  self.assertTrue(p.schedule is None)
3209  pths = p.paths
3210  keys = pths.keys()
3211  self.assertEqual(pths[keys[0]],p.path1)
3212  self.assertEqual(pths[keys[1]],p.path2)
3213  p.pset1 = PSet(parA = string("pset1"))
3214  p.pset2 = untracked.PSet(parA = string("pset2"))
3215  p.vpset1 = VPSet()
3216  p.vpset2 = untracked.VPSet()
3217  p.prune()
3218  self.assertTrue(hasattr(p, 'a'))
3219  self.assertTrue(hasattr(p, 'b'))
3220  self.assertTrue(not hasattr(p, 'c'))
3221  self.assertTrue(not hasattr(p, 'd'))
3222  self.assertTrue(hasattr(p, 'e'))
3223  self.assertTrue(not hasattr(p, 'f'))
3224  self.assertTrue(hasattr(p, 'g'))
3225  self.assertTrue(not hasattr(p, 's'))
3226  self.assertTrue(hasattr(p, 't1'))
3227  self.assertTrue(not hasattr(p, 't2'))
3228  self.assertTrue(hasattr(p, 't3'))
3229  self.assertTrue(hasattr(p, 'path1'))
3230  self.assertTrue(hasattr(p, 'path2'))
3231 # self.assertTrue(not hasattr(p, 'pset1'))
3232 # self.assertTrue(hasattr(p, 'pset2'))
3233 # self.assertTrue(not hasattr(p, 'vpset1'))
3234 # self.assertTrue(not hasattr(p, 'vpset2'))
3235 
3236  p = Process("test")
3237  p.a = EDAnalyzer("MyAnalyzer")
3238  p.b = EDAnalyzer("YourAnalyzer")
3239  p.c = EDAnalyzer("OurAnalyzer")
3240  p.d = EDAnalyzer("OurAnalyzer")
3241  p.e = EDAnalyzer("OurAnalyzer")
3242  p.f = EDProducer("MyProducer")
3243  p.g = EDProducer("YourProducer")
3244  p.h = EDProducer("TheirProducer")
3245  p.i = EDProducer("OurProducer")
3246  p.t1 = Task(p.f)
3247  p.t2 = Task(p.g)
3248  p.t3 = Task(p.h)
3249  p.t4 = Task(p.i)
3250  p.s = Sequence(p.d, p.t1)
3251  p.s2 = Sequence(p.b, p.t2)
3252  p.s3 = Sequence(p.e)
3253  p.path1 = Path(p.a, p.t3)
3254  p.path2 = Path(p.b)
3255  p.path3 = Path(p.b+p.s2)
3256  p.path4 = Path(p.b+p.s3)
3257  p.schedule = Schedule(p.path1,p.path2,p.path3)
3258  p.schedule.associate(p.t4)
3259  pths = p.paths
3260  keys = pths.keys()
3261  self.assertEqual(pths[keys[0]],p.path1)
3262  self.assertEqual(pths[keys[1]],p.path2)
3263  p.prune()
3264  self.assertTrue(hasattr(p, 'a'))
3265  self.assertTrue(hasattr(p, 'b'))
3266  self.assertTrue(not hasattr(p, 'c'))
3267  self.assertTrue(not hasattr(p, 'd'))
3268  self.assertTrue(not hasattr(p, 'e'))
3269  self.assertTrue(not hasattr(p, 'f'))
3270  self.assertTrue(hasattr(p, 'g'))
3271  self.assertTrue(hasattr(p, 'h'))
3272  self.assertTrue(hasattr(p, 'i'))
3273  self.assertTrue(not hasattr(p, 't1'))
3274  self.assertTrue(hasattr(p, 't2'))
3275  self.assertTrue(hasattr(p, 't3'))
3276  self.assertTrue(hasattr(p, 't4'))
3277  self.assertTrue(not hasattr(p, 's'))
3278  self.assertTrue(hasattr(p, 's2'))
3279  self.assertTrue(not hasattr(p, 's3'))
3280  self.assertTrue(hasattr(p, 'path1'))
3281  self.assertTrue(hasattr(p, 'path2'))
3282  self.assertTrue(hasattr(p, 'path3'))
3283  self.assertTrue(not hasattr(p, 'path4'))
3284  #test SequencePlaceholder
3285  p = Process("test")
3286  p.a = EDAnalyzer("MyAnalyzer")
3287  p.b = EDAnalyzer("YourAnalyzer")
3288  p.s = Sequence(SequencePlaceholder("a")+p.b)
3289  p.pth = Path(p.s)
3290  p.prune()
3291  self.assertTrue(hasattr(p, 'a'))
3292  self.assertTrue(hasattr(p, 'b'))
3293  self.assertTrue(hasattr(p, 's'))
3294  self.assertTrue(hasattr(p, 'pth'))
3295  #test unresolved SequencePlaceholder
3296  p = Process("test")
3297  p.b = EDAnalyzer("YourAnalyzer")
3298  p.s = Sequence(SequencePlaceholder("a")+p.b)
3299  p.pth = Path(p.s)
3300  p.prune(keepUnresolvedSequencePlaceholders=True)
3301  self.assertTrue(hasattr(p, 'b'))
3302  self.assertTrue(hasattr(p, 's'))
3303  self.assertTrue(hasattr(p, 'pth'))
3304  self.assertEqual(p.s.dumpPython(),'cms.Sequence(cms.SequencePlaceholder("a")+process.b)\n')
3305  #test TaskPlaceholder
3306  p = Process("test")
3307  p.a = EDProducer("MyProducer")
3308  p.b = EDProducer("YourProducer")
3309  p.s = Task(TaskPlaceholder("a"),p.b)
3310  p.pth = Path(p.s)
3311  p.prune()
3312  self.assertTrue(hasattr(p, 'a'))
3313  self.assertTrue(hasattr(p, 'b'))
3314  self.assertTrue(hasattr(p, 's'))
3315  self.assertTrue(hasattr(p, 'pth'))
3316  #test unresolved SequencePlaceholder
3317  p = Process("test")
3318  p.b = EDProducer("YourAnalyzer")
3319  p.s = Task(TaskPlaceholder("a"),p.b)
3320  p.pth = Path(p.s)
3321  p.prune(keepUnresolvedSequencePlaceholders=True)
3322  self.assertTrue(hasattr(p, 'b'))
3323  self.assertTrue(hasattr(p, 's'))
3324  self.assertTrue(hasattr(p, 'pth'))
self.assertEqual(p.s.dumpPython(),'cms.Task(cms.TaskPlaceholder("a"), process.b)\n')
tuple Path
Definition: mps_fire.py:298
def Config.TestModuleCommand.testRefToPSet (   self)

Definition at line 3092 of file Config.py.

References AlCaHLTBitMon_QueryRunRegistry.string, and HistogramManager_cfi.VPSet().

3093  def testRefToPSet(self):
3094  proc = Process("test")
3095  proc.top = PSet(a = int32(1))
3096  proc.ref = PSet(refToPSet_ = string("top"))
3097  proc.ref2 = PSet( a = int32(1), b = PSet( refToPSet_ = string("top")))
3098  proc.ref3 = PSet(refToPSet_ = string("ref"))
3099  proc.ref4 = VPSet(PSet(refToPSet_ = string("top")),
3100  PSet(refToPSet_ = string("ref2")))
3101  p = TestMakePSet()
3102  proc.fillProcessDesc(p)
3103  self.assertEqual((True,1),p.values["ref"][1].values["a"])
3104  self.assertEqual((True,1),p.values["ref3"][1].values["a"])
3105  self.assertEqual((True,1),p.values["ref2"][1].values["a"])
3106  self.assertEqual((True,1),p.values["ref2"][1].values["b"][1].values["a"])
3107  self.assertEqual((True,1),p.values["ref4"][1][0].values["a"])
self.assertEqual((True,1),p.values["ref4"][1][1].values["a"])
def Config.TestModuleCommand.testSchedule (   self)

Definition at line 2812 of file Config.py.

References mps_fire.Path, and cmsswSequenceInfo.Sequence.

2813  def testSchedule(self):
2814  p = Process("test")
2815  p.a = EDAnalyzer("MyAnalyzer")
2816  p.b = EDAnalyzer("YourAnalyzer")
2817  p.c = EDAnalyzer("OurAnalyzer")
2818  p.d = EDAnalyzer("OurAnalyzer")
2819  p.path1 = Path(p.a)
2820  p.path2 = Path(p.b)
2821  p.path3 = Path(p.d)
2822 
2823  s = Schedule(p.path1,p.path2)
2824  self.assertEqual(s[0],p.path1)
2825  self.assertEqual(s[1],p.path2)
2826  p.schedule = s
2827  self.assertTrue('b' in p.schedule.moduleNames())
2828  self.assertTrue(hasattr(p, 'b'))
2829  self.assertTrue(hasattr(p, 'c'))
2830  self.assertTrue(hasattr(p, 'd'))
2831  self.assertTrue(hasattr(p, 'path1'))
2832  self.assertTrue(hasattr(p, 'path2'))
2833  self.assertTrue(hasattr(p, 'path3'))
2834  p.prune()
2835  self.assertTrue('b' in p.schedule.moduleNames())
2836  self.assertTrue(hasattr(p, 'b'))
2837  self.assertTrue(not hasattr(p, 'c'))
2838  self.assertTrue(not hasattr(p, 'd'))
2839  self.assertTrue(hasattr(p, 'path1'))
2840  self.assertTrue(hasattr(p, 'path2'))
2841  self.assertTrue(not hasattr(p, 'path3'))
2842 
2843  self.assertTrue(len(p.schedule._tasks) == 0)
2844 
2845  p = Process("test")
2846  p.a = EDAnalyzer("MyAnalyzer")
2847  p.b = EDAnalyzer("YourAnalyzer")
2848  p.c = EDAnalyzer("OurAnalyzer")
2849  p.d = EDAnalyzer("dAnalyzer")
2850  p.e = EDProducer("eProducer")
2851  p.f = EDProducer("fProducer")
2852  p.Tracer = Service("Tracer")
2853  p.path1 = Path(p.a)
2854  p.path2 = Path(p.b)
2855  p.path3 = Path(p.d)
2856  p.task1 = Task(p.e)
2857  p.task2 = Task(p.f, p.Tracer)
2858  s = Schedule(p.path1,p.path2,tasks=[p.task1,p.task2,p.task1])
2859  self.assertEqual(s[0],p.path1)
2860  self.assertEqual(s[1],p.path2)
2861  self.assertTrue(len(s._tasks) == 2)
2862  self.assertTrue(p.task1 in s._tasks)
2863  self.assertTrue(p.task2 in s._tasks)
2864  listOfTasks = list(s._tasks)
2865  self.assertTrue(len(listOfTasks) == 2)
2866  self.assertTrue(p.task1 == listOfTasks[0])
2867  self.assertTrue(p.task2 == listOfTasks[1])
2868  p.schedule = s
2869  self.assertTrue('b' in p.schedule.moduleNames())
2870 
2871  process2 = Process("test")
2872  process2.a = EDAnalyzer("MyAnalyzer")
2873  process2.e = EDProducer("eProducer")
2874  process2.path1 = Path(process2.a)
2875  process2.task1 = Task(process2.e)
2876  process2.schedule = Schedule(process2.path1,tasks=process2.task1)
2877  listOfTasks = list(process2.schedule._tasks)
2878  self.assertTrue(listOfTasks[0] == process2.task1)
2879 
2880  # test Schedule copy
2881  s2 = s.copy()
2882  self.assertEqual(s2[0],p.path1)
2883  self.assertEqual(s2[1],p.path2)
2884  self.assertTrue(len(s2._tasks) == 2)
2885  self.assertTrue(p.task1 in s2._tasks)
2886  self.assertTrue(p.task2 in s2._tasks)
2887  listOfTasks = list(s2._tasks)
2888  self.assertTrue(len(listOfTasks) == 2)
2889  self.assertTrue(p.task1 == listOfTasks[0])
2890  self.assertTrue(p.task2 == listOfTasks[1])
2891 
2892  names = s.moduleNames()
2893  self.assertTrue(names == set(['a', 'b', 'e', 'Tracer', 'f']))
2894  #adding a path not attached to the Process should cause an exception
2895  p = Process("test")
2896  p.a = EDAnalyzer("MyAnalyzer")
2897  path1 = Path(p.a)
2898  s = Schedule(path1)
2899  self.assertRaises(RuntimeError, lambda : p.setSchedule_(s) )
2900 
2901  #make sure anonymous sequences work
2902  p = Process("test")
2903  p.a = EDAnalyzer("MyAnalyzer")
2904  p.b = EDAnalyzer("MyOtherAnalyzer")
2905  p.c = EDProducer("MyProd")
2906  path1 = Path(p.c*Sequence(p.a+p.b))
2907  s = Schedule(path1)
2908  self.assertTrue('a' in s.moduleNames())
2909  self.assertTrue('b' in s.moduleNames())
2910  self.assertTrue('c' in s.moduleNames())
2911  p.path1 = path1
2912  p.schedule = s
2913  p.prune()
2914  self.assertTrue('a' in s.moduleNames())
2915  self.assertTrue('b' in s.moduleNames())
2916  self.assertTrue('c' in s.moduleNames())
tuple Path
Definition: mps_fire.py:298
def Config.TestModuleCommand.testSecSource (   self)

Definition at line 2360 of file Config.py.

References Config._lineDiff(), and ConfigBuilder.dumpPython().

2361  def testSecSource(self):
2362  p = Process('test')
2363  p.a = SecSource("MySecSource")
2364  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),'process.a = cms.SecSource("MySecSource")')
def _lineDiff
Definition: Config.py:1831
def Config.TestModuleCommand.testSequence (   self)

Definition at line 2427 of file Config.py.

References mps_fire.Path, cmsswSequenceInfo.Sequence, and str.

2428  def testSequence(self):
2429  p = Process('test')
2430  p.a = EDAnalyzer("MyAnalyzer")
2431  p.b = EDAnalyzer("YourAnalyzer")
2432  p.c = EDAnalyzer("OurAnalyzer")
2433  p.s = Sequence(p.a*p.b)
2434  self.assertEqual(str(p.s),'a+b')
2435  self.assertEqual(p.s.label_(),'s')
2436  path = Path(p.c+p.s)
2437  self.assertEqual(str(path),'c+a+b')
2438  p._validateSequence(path, 'p1')
2439  notInProcess = EDAnalyzer('NotInProcess')
2440  p2 = Path(p.c+p.s*notInProcess)
2441  self.assertRaises(RuntimeError, p._validateSequence, p2, 'p2')
tuple Path
Definition: mps_fire.py:298
#define str(s)
def Config.TestModuleCommand.testSequence2 (   self)

Definition at line 2442 of file Config.py.

References cmsswSequenceInfo.Sequence.

2443  def testSequence2(self):
2444  p = Process('test')
2445  p.a = EDAnalyzer("MyAnalyzer")
2446  p.b = EDAnalyzer("YourAnalyzer")
2447  p.c = EDAnalyzer("OurAnalyzer")
2448  testseq = Sequence(p.a*p.b)
2449  p.s = testseq
2450  #p.y = testseq
2451  self.assertRaises(ValueError, p.__setattr__, "y", testseq)
def Config.TestModuleCommand.testServiceInProcess (   self)

Definition at line 2452 of file Config.py.

2453  def testServiceInProcess(self):
2454  service = Service("d")
2455  self.assertFalse(service._inProcess)
2456  process = Process("test")
2457  process.d = service
2458  self.assertTrue(service._inProcess)
2459  service2 = Service("d")
2460  process.d = service2
2461  self.assertFalse(service._inProcess)
2462  self.assertTrue(service2._inProcess)
2463  del process.d
2464  self.assertFalse(service2._inProcess)
def Config.TestModuleCommand.testSubProcess (   self)

Definition at line 3057 of file Config.py.

References Config._lineDiff(), ConfigBuilder.dumpPython(), cond.hash, mps_fire.Path, submitPVValidationJobs.split(), and str.

3058  def testSubProcess(self):
3059  process = Process("Parent")
3060  subProcess = Process("Child")
3061  subProcess.a = EDProducer("A")
3062  subProcess.p = Path(subProcess.a)
3063  subProcess.add_(Service("Foo"))
3064  process.addSubProcess(SubProcess(subProcess))
3065  d = process.dumpPython()
3066  equalD ="""parentProcess = process
3067 process.a = cms.EDProducer("A")
3068 process.Foo = cms.Service("Foo")
3069 process.p = cms.Path(process.a)
3070 childProcess = process
3071 process = parentProcess
3072 process.addSubProcess(cms.SubProcess(process = childProcess, SelectEvents = cms.untracked.PSet(
3073 ), outputCommands = cms.untracked.vstring()))"""
3074  equalD = equalD.replace("parentProcess","parentProcess"+str(hash(process.subProcesses_()[0])))
3075  # SubProcesses are dumped before Services, so in order to
3076  # craft the dump of the Parent and Child manually the dump
3077  # of the Parent needs to be split at the MessageLogger
3078  # boundary (now when it is part of Process by default),
3079  # and insert the dump of the Child between the top part of
3080  # the Parent (before MessageLogger) and the bottom part of
3081  # the Parent (after and including MessageLogger)
3082  messageLoggerSplit = 'process.MessageLogger = cms.Service'
3083  parentDumpSplit = Process('Parent').dumpPython().split(messageLoggerSplit)
3084  childProcess = Process('Child')
3085  del childProcess.MessageLogger
3086  combinedDump = parentDumpSplit[0] + childProcess.dumpPython() + messageLoggerSplit + parentDumpSplit[1]
3087  self.assertEqual(_lineDiff(d, combinedDump), equalD)
3088  p = TestMakePSet()
3089  process.fillProcessDesc(p)
3090  self.assertEqual((True,['a']),p.values["subProcesses"][1][0].values["process"][1].values['@all_modules'])
3091  self.assertEqual((True,['p']),p.values["subProcesses"][1][0].values["process"][1].values['@paths'])
self.assertEqual({'@service_type':(True,'Foo')}, p.values["subProcesses"][1][0].values["process"][1].values["services"][1][0].values)
tuple Path
Definition: mps_fire.py:298
def _lineDiff
Definition: Config.py:1831
#define str(s)
def Config.TestModuleCommand.testSwitchProducer (   self)

Definition at line 3108 of file Config.py.

References mps_fire.Path, cmsswSequenceInfo.Sequence, AlCaHLTBitMon_QueryRunRegistry.string, and HistogramManager_cfi.VPSet().

3109  def testSwitchProducer(self):
3110  proc = Process("test")
3111  proc.sp = SwitchProducerTest(test2 = EDProducer("Foo",
3112  a = int32(1),
3113  b = PSet(c = int32(2))),
3114  test1 = EDProducer("Bar",
3115  aa = int32(11),
3116  bb = PSet(cc = int32(12))))
3117  proc.a = EDProducer("A")
3118  proc.s = Sequence(proc.a + proc.sp)
3119  proc.t = Task(proc.a, proc.sp)
3120  proc.p = Path()
3121  proc.p.associate(proc.t)
3122  p = TestMakePSet()
3123  proc.fillProcessDesc(p)
3124  self.assertEqual((True,"EDProducer"), p.values["sp"][1].values["@module_edm_type"])
3125  self.assertEqual((True, "SwitchProducer"), p.values["sp"][1].values["@module_type"])
3126  self.assertEqual((True, "sp"), p.values["sp"][1].values["@module_label"])
3127  all_cases = copy.deepcopy(p.values["sp"][1].values["@all_cases"])
3128  all_cases[1].sort() # names of all cases come via dict, i.e. their order is undefined
3129  self.assertEqual((True, ["sp@test1", "sp@test2"]), all_cases)
3130  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
3131  self.assertEqual(["a", "sp", "sp@test1", "sp@test2"], p.values["@all_modules"][1])
3132  self.assertEqual((True,"EDProducer"), p.values["sp@test1"][1].values["@module_edm_type"])
3133  self.assertEqual((True,"Bar"), p.values["sp@test1"][1].values["@module_type"])
3134  self.assertEqual((True,"EDProducer"), p.values["sp@test2"][1].values["@module_edm_type"])
3135  self.assertEqual((True,"Foo"), p.values["sp@test2"][1].values["@module_type"])
3136  dump = proc.dumpPython()
3137  self.assertEqual(dump.find('@'), -1)
3138  self.assertEqual(specialImportRegistry.getSpecialImports(), ["from test import SwitchProducerTest"])
3139  self.assertTrue(dump.find("\nfrom test import SwitchProducerTest\n") != -1)
3140 
3141  # EDAlias as non-chosen case
3142  proc = Process("test")
3143  proc.sp = SwitchProducerTest(test2 = EDProducer("Foo",
3144  a = int32(1),
3145  b = PSet(c = int32(2))),
3146  test1 = EDAlias(a = VPSet(PSet(type = string("Bar")))))
3147  proc.a = EDProducer("A")
3148  proc.s = Sequence(proc.a + proc.sp)
3149  proc.t = Task(proc.a, proc.sp)
3150  proc.p = Path()
3151  proc.p.associate(proc.t)
3152  p = TestMakePSet()
3153  proc.fillProcessDesc(p)
3154  self.assertEqual((True,"EDProducer"), p.values["sp"][1].values["@module_edm_type"])
3155  self.assertEqual((True, "SwitchProducer"), p.values["sp"][1].values["@module_type"])
3156  self.assertEqual((True, "sp"), p.values["sp"][1].values["@module_label"])
3157  all_cases = copy.deepcopy(p.values["sp"][1].values["@all_cases"])
3158  all_cases[1].sort()
3159  self.assertEqual((True, ["sp@test1", "sp@test2"]), all_cases)
3160  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
3161  self.assertEqual(["a", "sp", "sp@test2"], p.values["@all_modules"][1])
3162  self.assertEqual(["sp@test1"], p.values["@all_aliases"][1])
3163  self.assertEqual((True,"EDProducer"), p.values["sp@test2"][1].values["@module_edm_type"])
3164  self.assertEqual((True,"Foo"), p.values["sp@test2"][1].values["@module_type"])
3165  self.assertEqual((True,"EDAlias"), p.values["sp@test1"][1].values["@module_edm_type"])
3166  self.assertEqual((True,"Bar"), p.values["sp@test1"][1].values["a"][1][0].values["type"])
3167 
3168  # EDAlias as chosen case
3169  proc = Process("test")
3170  proc.sp = SwitchProducerTest(test1 = EDProducer("Foo",
3171  a = int32(1),
3172  b = PSet(c = int32(2))),
3173  test2 = EDAlias(a = VPSet(PSet(type = string("Bar")))))
3174  proc.a = EDProducer("A")
3175  proc.s = Sequence(proc.a + proc.sp)
3176  proc.t = Task(proc.a, proc.sp)
3177  proc.p = Path()
3178  proc.p.associate(proc.t)
3179  p = TestMakePSet()
3180  proc.fillProcessDesc(p)
3181  self.assertEqual((True,"EDProducer"), p.values["sp"][1].values["@module_edm_type"])
3182  self.assertEqual((True, "SwitchProducer"), p.values["sp"][1].values["@module_type"])
3183  self.assertEqual((True, "sp"), p.values["sp"][1].values["@module_label"])
3184  self.assertEqual((True, ["sp@test1", "sp@test2"]), p.values["sp"][1].values["@all_cases"])
3185  self.assertEqual((False, "sp@test2"), p.values["sp"][1].values["@chosen_case"])
3186  self.assertEqual(["a", "sp", "sp@test1"], p.values["@all_modules"][1])
3187  self.assertEqual(["sp@test2"], p.values["@all_aliases"][1])
3188  self.assertEqual((True,"EDProducer"), p.values["sp@test1"][1].values["@module_edm_type"])
3189  self.assertEqual((True,"Foo"), p.values["sp@test1"][1].values["@module_type"])
3190  self.assertEqual((True,"EDAlias"), p.values["sp@test2"][1].values["@module_edm_type"])
3191  self.assertEqual((True,"Bar"), p.values["sp@test2"][1].values["a"][1][0].values["type"])
tuple Path
Definition: mps_fire.py:298
def Config.TestModuleCommand.testTask (   self)

Definition at line 2465 of file Config.py.

References mps_fire.Path, and cmsswSequenceInfo.Sequence.

2466  def testTask(self):
2467 
2468  # create some objects to use in tests
2469  edanalyzer = EDAnalyzer("a")
2470  edproducer = EDProducer("b")
2471  edproducer2 = EDProducer("b2")
2472  edproducer3 = EDProducer("b3")
2473  edproducer4 = EDProducer("b4")
2474  edproducer8 = EDProducer("b8")
2475  edproducer9 = EDProducer("b9")
2476  edfilter = EDFilter("c")
2477  service = Service("d")
2478  service3 = Service("d")
2479  essource = ESSource("e")
2480  esproducer = ESProducer("f")
2481  testTask2 = Task()
2482 
2483  # test adding things to Tasks
2484  testTask1 = Task(edproducer, edfilter)
2485  self.assertRaises(RuntimeError, testTask1.add, edanalyzer)
2486  testTask1.add(essource, service)
2487  testTask1.add(essource, esproducer)
2488  testTask1.add(testTask2)
2489  coll = testTask1._collection
2490  self.assertTrue(edproducer in coll)
2491  self.assertTrue(edfilter in coll)
2492  self.assertTrue(service in coll)
2493  self.assertTrue(essource in coll)
2494  self.assertTrue(esproducer in coll)
2495  self.assertTrue(testTask2 in coll)
2496  self.assertTrue(len(coll) == 6)
2497  self.assertTrue(len(testTask2._collection) == 0)
2498 
2499  taskContents = []
2500  for i in testTask1:
2501  taskContents.append(i)
2502  self.assertTrue(taskContents == [edproducer, edfilter, essource, service, esproducer, testTask2])
2503 
2504  # test attaching Task to Process
2505  process = Process("test")
2506 
2507  process.mproducer = edproducer
2508  process.mproducer2 = edproducer2
2509  process.mfilter = edfilter
2510  process.messource = essource
2511  process.mesproducer = esproducer
2512  process.d = service
2513 
2514  testTask3 = Task(edproducer, edproducer2)
2515  testTask1.add(testTask3)
2516  process.myTask1 = testTask1
2517 
2518  # test the validation that occurs when attaching a Task to a Process
2519  # first a case that passes, then one the fails on an EDProducer
2520  # then one that fails on a service
2521  l = set()
2522  visitor = NodeNameVisitor(l)
2523  testTask1.visit(visitor)
2524  self.assertTrue(l == set(['mesproducer', 'mproducer', 'mproducer2', 'mfilter', 'd', 'messource']))
2525  l2 = testTask1.moduleNames
2526  self.assertTrue(l == set(['mesproducer', 'mproducer', 'mproducer2', 'mfilter', 'd', 'messource']))
2527 
2528  testTask4 = Task(edproducer3)
2529  l.clear()
2530  self.assertRaises(RuntimeError, testTask4.visit, visitor)
2531  try:
2532  process.myTask4 = testTask4
2533  self.assertTrue(False)
2534  except RuntimeError:
2535  pass
2536 
2537  testTask5 = Task(service3)
2538  l.clear()
2539  self.assertRaises(RuntimeError, testTask5.visit, visitor)
2540  try:
2541  process.myTask5 = testTask5
2542  self.assertTrue(False)
2543  except RuntimeError:
2544  pass
2545 
2546  process.d = service3
2547  process.myTask5 = testTask5
2548 
2549  # test placement into the Process and the tasks property
2550  expectedDict = { 'myTask1' : testTask1, 'myTask5' : testTask5 }
2551  expectedFixedDict = DictTypes.FixedKeysDict(expectedDict);
2552  self.assertTrue(process.tasks == expectedFixedDict)
2553  self.assertTrue(process.tasks['myTask1'] == testTask1)
2554  self.assertTrue(process.myTask1 == testTask1)
2555 
2556  # test replacing an EDProducer in a Task when calling __settattr__
2557  # for the EDProducer on the Process.
2558  process.mproducer2 = edproducer4
2559  process.d = service
2560  l = list()
2561  visitor1 = ModuleNodeVisitor(l)
2562  testTask1.visit(visitor1)
2563  l.sort(key=lambda mod: mod.__str__())
2564  expectedList = sorted([edproducer,essource,esproducer,service,edfilter,edproducer,edproducer4],key=lambda mod: mod.__str__())
2565  self.assertTrue(expectedList == l)
2566  process.myTask6 = Task()
2567  process.myTask7 = Task()
2568  process.mproducer8 = edproducer8
2569  process.myTask8 = Task(process.mproducer8)
2570  process.myTask6.add(process.myTask7)
2571  process.myTask7.add(process.myTask8)
2572  process.myTask1.add(process.myTask6)
2573  process.myTask8.add(process.myTask5)
2574 
2575  testDict = process._itemsInDependencyOrder(process.tasks)
2576  expectedLabels = ["myTask5", "myTask8", "myTask7", "myTask6", "myTask1"]
2577  expectedTasks = [process.myTask5, process.myTask8, process.myTask7, process.myTask6, process.myTask1]
2578  index = 0
2579  for testLabel, testTask in testDict.items():
2580  self.assertTrue(testLabel == expectedLabels[index])
2581  self.assertTrue(testTask == expectedTasks[index])
2582  index += 1
2583 
2584  pythonDump = testTask1.dumpPython(PrintOptions())
2585 
2586 
2587  expectedPythonDump = 'cms.Task(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer, process.mproducer2, process.myTask6)\n'
2588  self.assertTrue(pythonDump == expectedPythonDump)
2589 
2590  process.myTask5 = Task()
2591  process.myTask100 = Task()
2592  process.mproducer9 = edproducer9
2593  sequence1 = Sequence(process.mproducer8, process.myTask1, process.myTask5, testTask2, testTask3)
2594  sequence2 = Sequence(process.mproducer8 + process.mproducer9)
2595  process.sequence3 = Sequence((process.mproducer8 + process.mfilter))
2596  sequence4 = Sequence()
2597  process.path1 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+sequence4)
2598  process.path1.associate(process.myTask1, process.myTask5, testTask2, testTask3)
2599  process.path11 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+ sequence4,process.myTask1, process.myTask5, testTask2, testTask3, process.myTask100)
2600  process.path2 = Path(process.mproducer)
2601  process.path3 = Path(process.mproducer9+process.mproducer8,testTask2)
2602 
2603  self.assertTrue(process.path1.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)\n')
2604 
2605  self.assertTrue(process.path11.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask100, process.myTask5)\n')
2606 
2607  # test NodeNameVisitor and moduleNames
2608  l = set()
2609  nameVisitor = NodeNameVisitor(l)
2610  process.path1.visit(nameVisitor)
2611  self.assertTrue(l == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
2612  self.assertTrue(process.path1.moduleNames() == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
2613 
2614  # test copy
2615  process.mproducer10 = EDProducer("b10")
2616  process.path21 = process.path11.copy()
2617  process.path21.replace(process.mproducer, process.mproducer10)
2618 
2619  self.assertTrue(process.path11.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask100, process.myTask5)\n')
2620 
2621  # Some peculiarities of the way things work show up here. dumpPython sorts tasks and
2622  # removes duplication at the level of strings. The Task and Sequence objects themselves
2623  # remove duplicate tasks in their contents if the instances are the same (exact same python
2624  # object id which is not the same as the string representation being the same).
2625  # Also note that the mutating visitor replaces sequences and tasks that have
2626  # modified contents with their modified contents, it does not modify the sequence
2627  # or task itself.
2628  self.assertTrue(process.path21.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer10+process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer10), cms.Task(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer10, process.mproducer2, process.mproducer8, process.myTask5), process.myTask100, process.myTask5)\n')
2629 
2630  process.path22 = process.path21.copyAndExclude([process.d, process.mesproducer, process.mfilter])
2631  self.assertTrue(process.path22.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer10+process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer10), cms.Task(process.messource, process.mproducer10, process.mproducer2, process.mproducer8, process.myTask5), process.myTask100, process.myTask5)\n')
2632 
2633  process.path23 = process.path22.copyAndExclude([process.messource, process.mproducer10])
2634  self.assertTrue(process.path23.dumpPython(PrintOptions()) == 'cms.Path(process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.mproducer8, cms.Task(), cms.Task(process.None), cms.Task(process.mproducer2, process.mproducer8, process.myTask5), process.myTask100, process.myTask5)\n')
2635 
2636  process.a = EDAnalyzer("MyAnalyzer")
2637  process.b = OutputModule("MyOutputModule")
2638  process.c = EDFilter("MyFilter")
2639  process.d = EDProducer("MyProducer")
2640  process.e = ESProducer("MyESProducer")
2641  process.f = ESSource("MyESSource")
2642  process.g = ESProducer("g")
2643  process.path24 = Path(process.a+process.b+process.c+process.d)
2644  process.path25 = process.path24.copyAndExclude([process.a,process.b,process.c])
2645  self.assertTrue(process.path25.dumpPython() == 'cms.Path(process.d)\n')
2646  #print process.path3
2647  #print process.dumpPython()
2648 
2649  process.path200 = EndPath(Sequence(process.c,Task(process.e)))
2650  process.path200.replace(process.c,process.b)
2651  process.path200.replace(process.e,process.f)
2652  self.assertEqual(process.path200.dumpPython(), "cms.EndPath(process.b, cms.Task(process.f))\n")
2653  process.path200.replace(process.b,process.c)
2654  process.path200.replace(process.f,process.e)
2655  self.assertEqual(process.path200.dumpPython(), "cms.EndPath(process.c, cms.Task(process.e))\n")
2656  process.path200.replace(process.c,process.a)
2657  process.path200.replace(process.e,process.g)
2658  self.assertEqual(process.path200.dumpPython(), "cms.EndPath(process.a, cms.Task(process.g))\n")
2659  process.path200.replace(process.a,process.c)
2660  process.path200.replace(process.g,process.e)
2661  self.assertEqual(process.path200.dumpPython(), "cms.EndPath(process.c, cms.Task(process.e))\n")
2662 
tuple Path
Definition: mps_fire.py:298
def Config.TestModuleCommand.testTaskPlaceholder (   self)

Definition at line 3325 of file Config.py.

References Config._lineDiff(), ConfigBuilder.dumpPython(), and mps_fire.Path.

3326  def testTaskPlaceholder(self):
3327  p = Process("test")
3328  p.a = EDProducer("ma")
3329  p.b = EDAnalyzer("mb")
3330  p.t1 = Task(TaskPlaceholder("c"))
3331  p.t2 = Task(p.a, TaskPlaceholder("d"), p.t1)
3332  p.t3 = Task(TaskPlaceholder("e"))
3333  p.path1 = Path(p.b, p.t2, p.t3)
3334  p.t5 = Task(p.a, TaskPlaceholder("g"), TaskPlaceholder("t4"))
3335  p.t4 = Task(TaskPlaceholder("f"))
3336  p.endpath1 = EndPath(p.b, p.t5)
3337  p.t6 = Task(TaskPlaceholder("h"))
3338  p.t7 = Task(p.a, TaskPlaceholder("i"), p.t6)
3339  p.t8 = Task(TaskPlaceholder("j"))
3340  p.schedule = Schedule(p.path1, p.endpath1,tasks=[p.t7,p.t8])
3341  p.c = EDProducer("mc")
3342  p.d = EDProducer("md")
3343  p.e = EDProducer("me")
3344  p.f = EDProducer("mf")
3345  p.g = EDProducer("mg")
3346  p.h = EDProducer("mh")
3347  p.i = EDProducer("mi")
3348  p.j = EDProducer("mj")
3349  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),
3350 """process.a = cms.EDProducer("ma")
3351 process.c = cms.EDProducer("mc")
3352 process.d = cms.EDProducer("md")
3353 process.e = cms.EDProducer("me")
3354 process.f = cms.EDProducer("mf")
3355 process.g = cms.EDProducer("mg")
3356 process.h = cms.EDProducer("mh")
3357 process.i = cms.EDProducer("mi")
3358 process.j = cms.EDProducer("mj")
3359 process.b = cms.EDAnalyzer("mb")
3360 process.t1 = cms.Task(cms.TaskPlaceholder("c"))
3361 process.t2 = cms.Task(cms.TaskPlaceholder("d"), process.a, process.t1)
3362 process.t3 = cms.Task(cms.TaskPlaceholder("e"))
3363 process.t5 = cms.Task(cms.TaskPlaceholder("g"), cms.TaskPlaceholder("t4"), process.a)
3364 process.t4 = cms.Task(cms.TaskPlaceholder("f"))
3365 process.t6 = cms.Task(cms.TaskPlaceholder("h"))
3366 process.t7 = cms.Task(cms.TaskPlaceholder("i"), process.a, process.t6)
3367 process.t8 = cms.Task(cms.TaskPlaceholder("j"))
3368 process.path1 = cms.Path(process.b, process.t2, process.t3)
3369 process.endpath1 = cms.EndPath(process.b, process.t5)
3370 process.schedule = cms.Schedule(*[ process.path1, process.endpath1 ], tasks=[process.t7, process.t8])""")
3371  p.resolve()
3372  self.assertEqual(_lineDiff(p.dumpPython(),Process('test').dumpPython()),
3373 """process.a = cms.EDProducer("ma")
3374 process.c = cms.EDProducer("mc")
3375 process.d = cms.EDProducer("md")
3376 process.e = cms.EDProducer("me")
3377 process.f = cms.EDProducer("mf")
3378 process.g = cms.EDProducer("mg")
3379 process.h = cms.EDProducer("mh")
3380 process.i = cms.EDProducer("mi")
3381 process.j = cms.EDProducer("mj")
3382 process.b = cms.EDAnalyzer("mb")
3383 process.t1 = cms.Task(process.c)
3384 process.t2 = cms.Task(process.a, process.d, process.t1)
3385 process.t3 = cms.Task(process.e)
3386 process.t4 = cms.Task(process.f)
3387 process.t6 = cms.Task(process.h)
3388 process.t7 = cms.Task(process.a, process.i, process.t6)
3389 process.t8 = cms.Task(process.j)
3390 process.t5 = cms.Task(process.a, process.g, process.t4)
3391 process.path1 = cms.Path(process.b, process.t2, process.t3)
3392 process.endpath1 = cms.EndPath(process.b, process.t5)
3393 process.schedule = cms.Schedule(*[ process.path1, process.endpath1 ], tasks=[process.t7, process.t8])""")
tuple Path
Definition: mps_fire.py:298
def _lineDiff
Definition: Config.py:1831
def Config.TestModuleCommand.testTypedParameterizable (   self)

Definition at line 1965 of file Config.py.

1966  def testTypedParameterizable(self):
1967  p = _TypedParameterizable("blah", b=int32(1))
1968  #see if copy works deeply
1969  other = p.copy()
1970  other.b = 2
1971  self.assertNotEqual(p.b,other.b)
def Config.TestModuleCommand.testUsing (   self)

Definition at line 2950 of file Config.py.

2951  def testUsing(self):
2952  p = Process('test')
2953  p.block = PSet(a = int32(1))
2954  p.modu = EDAnalyzer('Analyzer', p.block, b = int32(2))
2955  self.assertEqual(p.modu.a.value(),1)
2956  self.assertEqual(p.modu.b.value(),2)

Member Data Documentation

tuple Config.TestModuleCommand.a = EDProducer("A")
static

Definition at line 2336 of file Config.py.

Config.TestModuleCommand.a

Definition at line 3533 of file Config.py.

tuple Config.TestModuleCommand.d = p.dumpPython()
static

Definition at line 2265 of file Config.py.

tuple Config.TestModuleCommand.p = Process("test")
static

Definition at line 2258 of file Config.py.

Referenced by Electron.Electron.ptErr().

Config.TestModuleCommand.proc_mod_

Definition at line 3530 of file Config.py.

tuple Config.TestModuleCommand.process = Process("DUMP")
static

Definition at line 2339 of file Config.py.

Referenced by adaptToRunAtMiniAOD.adaptToRunAtMiniAOD.convertModuleToMiniAODInput(), runTauIdMVA.TauIDEmbedder.processDeepProducer(), runTauIdMVA.TauIDEmbedder.runTauID(), and runTauIdMVA.TauIDEmbedder.tauIDMVAinputs().

tuple Config.TestModuleCommand.s = Sequence(p.a)
static

Definition at line 2261 of file Config.py.

tuple Config.TestModuleCommand.s1 = Sequence(s)
static

Definition at line 2347 of file Config.py.

tuple Config.TestModuleCommand.s2 = Sequence(a)
static

Definition at line 2337 of file Config.py.

tuple Config.TestModuleCommand.s3 = Sequence(a+a)
static

Definition at line 2349 of file Config.py.

tuple Config.TestModuleCommand.task2 = Task(p.f, p.g)
static

Definition at line 2318 of file Config.py.