CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
Config.TestModuleCommand Class Reference
Inheritance diagram for Config.TestModuleCommand:

Public Member Functions

def setUp (self)
 
def testCloneSequence (self)
 
def testContains (self)
 
def testDelete (self)
 
def testExamples (self)
 
def testFreeze (self)
 
def testGlobalReplace (self)
 
def testImplicitSchedule (self)
 
def testModifier (self)
 
def testOverride (self)
 
def testParameterizable (self)
 
def testPath (self)
 
def testPrefers (self)
 
def testProcessDumpPython (self)
 
def testProcessExtend (self)
 
def testProcessInsertion (self)
 
def testPrune (self)
 
def testRefToPSet (self)
 
def testSchedule (self)
 
def testSecSource (self)
 
def testSequence (self)
 
def testSequence2 (self)
 
def testServiceInProcess (self)
 
def testSubProcess (self)
 
def testTask (self)
 
def testTaskPlaceholder (self)
 
def testTypedParameterizable (self)
 
def testUsing (self)
 

Public Attributes

 a
 
 proc_mod_
 

Detailed Description

Definition at line 1553 of file Config.py.

Member Function Documentation

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

Definition at line 1554 of file Config.py.

1554  def setUp(self):
1555  """Nothing to do """
1556  None
def Config.TestModuleCommand.testCloneSequence (   self)

Definition at line 2274 of file Config.py.

References triggerObjects_cff.id, and str.

2275  p = Process("test")
2276  a = EDAnalyzer("MyAnalyzer")
2277  p.a = a
2278  a.setLabel("a")
2279  b = EDAnalyzer("YOurAnalyzer")
2280  p.b = b
2281  b.setLabel("b")
2282  path = Path(a * b)
2283  p.path = Path(p.a*p.b)
2284  lookuptable = {id(a): p.a, id(b): p.b}
2285  #self.assertEqual(str(path),str(path._postProcessFixup(lookuptable)))
2286  #lookuptable = p._cloneToObjectDict
2287  #self.assertEqual(str(path),str(path._postProcessFixup(lookuptable)))
2288  self.assertEqual(str(path),str(p.path))
2289 
def testCloneSequence(self)
Definition: Config.py:2274
#define str(s)
def Config.TestModuleCommand.testContains (   self)

Definition at line 2290 of file Config.py.

2290  def testContains(self):
2291 
2292  a = EDProducer("a")
2293  b = EDProducer("b")
2294  c = EDProducer("c")
2295  d = EDProducer("d")
2296  e = EDProducer("e")
2297  f = EDProducer("f")
2298  g = EDProducer("g")
2299  h = EDProducer("h")
2300  i = EDProducer("i")
2301  j = EDProducer("j")
2302  k = EDProducer("k")
2303  l = EDProducer("l")
2304  m = EDProducer("m")
2305  n = EDProducer("n")
2306 
2307  seq1 = Sequence(e)
2308  task1 = Task(g)
2309  path = Path(a * c * seq1, task1)
2310 
2311  self.assertTrue(path.contains(a))
2312  self.assertFalse(path.contains(b))
2313  self.assertTrue(path.contains(c))
2314  self.assertFalse(path.contains(d))
2315  self.assertTrue(path.contains(e))
2316  self.assertFalse(path.contains(f))
2317  self.assertTrue(path.contains(g))
2318 
2319  endpath = EndPath(h * i)
2320  self.assertFalse(endpath.contains(b))
2321  self.assertTrue(endpath.contains(i))
2322 
2323  seq = Sequence(a * c)
2324  self.assertFalse(seq.contains(b))
2325  self.assertTrue(seq.contains(c))
2326 
2327  task2 = Task(l)
2328  task = Task(j, k, task2)
2329  self.assertFalse(task.contains(b))
2330  self.assertTrue(task.contains(j))
2331  self.assertTrue(task.contains(k))
2332  self.assertTrue(task.contains(l))
2333 
2334  task3 = Task(m)
2335  path2 = Path(n)
2336  sch = Schedule(path, path2, tasks=[task,task3])
2337  self.assertFalse(sch.contains(b))
2338  self.assertTrue(sch.contains(a))
2339  self.assertTrue(sch.contains(c))
2340  self.assertTrue(sch.contains(e))
2341  self.assertTrue(sch.contains(g))
2342  self.assertTrue(sch.contains(n))
2343  self.assertTrue(sch.contains(j))
2344  self.assertTrue(sch.contains(k))
2345  self.assertTrue(sch.contains(l))
2346  self.assertTrue(sch.contains(m))
2347 
def testContains(self)
Definition: Config.py:2290
def Config.TestModuleCommand.testDelete (   self)

Definition at line 2898 of file Config.py.

References ConfigBuilder.dumpPython().

2898  def testDelete(self):
2899  p = Process("test")
2900  p.a = EDAnalyzer("MyAnalyzer")
2901  p.b = EDAnalyzer("YourAnalyzer")
2902  p.c = EDAnalyzer("OurAnalyzer")
2903  p.d = EDAnalyzer("OurAnalyzer")
2904  p.e = EDAnalyzer("OurAnalyzer")
2905  p.f = EDAnalyzer("OurAnalyzer")
2906  p.g = EDProducer("OurProducer")
2907  p.h = EDProducer("YourProducer")
2908  p.t1 = Task(p.g, p.h)
2909  t2 = Task(p.g, p.h)
2910  t3 = Task(p.g, p.h)
2911  p.s = Sequence(p.d+p.e)
2912  p.path1 = Path(p.a+p.f+p.s,t2)
2913  p.endpath1 = EndPath(p.b+p.f)
2914  p.schedule = Schedule(tasks=[t3])
2915  self.assertTrue(hasattr(p, 'f'))
2916  self.assertTrue(hasattr(p, 'g'))
2917  del p.e
2918  del p.f
2919  del p.g
2920  self.assertFalse(hasattr(p, 'f'))
2921  self.assertFalse(hasattr(p, 'g'))
2922  self.assertTrue(p.t1.dumpPython(None) == 'cms.Task(process.h)\n')
2923  self.assertTrue(p.s.dumpPython(None) == 'cms.Sequence(process.d)\n')
2924  self.assertTrue(p.path1.dumpPython(None) == 'cms.Path(process.a+process.s, cms.Task(process.h))\n')
2925  self.assertTrue(p.endpath1.dumpPython(None) == 'cms.EndPath(process.b)\n')
2926  del p.s
2927  self.assertTrue(p.path1.dumpPython(None) == 'cms.Path(process.a+(process.d), cms.Task(process.h))\n')
2928  self.assertTrue(p.schedule_().dumpPython(None) == 'cms.Schedule(tasks=[cms.Task(process.h)])\n')
def dumpPython(process, name)
def Config.TestModuleCommand.testExamples (   self)

Definition at line 2516 of file Config.py.

2516  def testExamples(self):
2517  p = Process("Test")
2518  p.source = Source("PoolSource",fileNames = untracked(string("file:reco.root")))
2519  p.foos = EDProducer("FooProducer")
2520  p.bars = EDProducer("BarProducer", foos=InputTag("foos"))
2521  p.out = OutputModule("PoolOutputModule",fileName=untracked(string("file:foos.root")))
2522  p.bars.foos = 'Foosball'
2523  self.assertEqual(p.bars.foos, InputTag('Foosball'))
2524  p.p = Path(p.foos*p.bars)
2525  p.e = EndPath(p.out)
2526  p.add_(Service("MessageLogger"))
2527 
def testExamples(self)
Definition: Config.py:2516
def Config.TestModuleCommand.testFreeze (   self)

Definition at line 2582 of file Config.py.

2582  def testFreeze(self):
2583  process = Process("Freeze")
2584  m = EDProducer("M", p=PSet(i = int32(1)))
2585  m.p.i = 2
2586  process.m = m
2587  # should be frozen
2588  #self.assertRaises(ValueError, setattr, m.p, 'i', 3)
2589  #self.assertRaises(ValueError, setattr, m, 'p', PSet(i=int32(1)))
2590  #self.assertRaises(ValueError, setattr, m.p, 'j', 1)
2591  #self.assertRaises(ValueError, setattr, m, 'j', 1)
2592  # But OK to change through the process
2593  process.m.p.i = 4
2594  self.assertEqual(process.m.p.i.value(), 4)
2595  process.m.p = PSet(j=int32(1))
2596  # should work to clone it, though
2597  m2 = m.clone(p = PSet(i = int32(5)), j = int32(8))
2598  m2.p.i = 6
2599  m2.j = 8
def Config.TestModuleCommand.testGlobalReplace (   self)

Definition at line 1952 of file Config.py.

References list(), and cmsPerfHarvest.visit().

1953  p = Process('test')
1954  p.a = EDAnalyzer("MyAnalyzer")
1955  old = p.a
1956  p.b = EDAnalyzer("YourAnalyzer")
1957  p.c = EDAnalyzer("OurAnalyzer")
1958  p.d = EDProducer("MyProducer")
1959  old2 = p.d
1960  p.t1 = Task(p.d)
1961  t2 = Task(p.d)
1962  t3 = Task(p.d)
1963  t4 = Task(p.d)
1964  t5 = Task(p.d)
1965  t6 = Task(p.d)
1966  s = Sequence(p.a*p.b)
1967  p.s4 = Sequence(p.a*p.b)
1968  s.associate(t2)
1969  p.s4.associate(t2)
1970  p.p = Path(p.c+s+p.a)
1971  p.e3 = EndPath(p.c+s+p.a)
1972  new = EDAnalyzer("NewAnalyzer")
1973  new2 = EDProducer("NewProducer")
1974  visitor1 = NodeVisitor()
1975  p.p.visit(visitor1)
1976  self.assertTrue(visitor1.modules == set([old,old2,p.b,p.c]))
1977  p.schedule = Schedule(tasks=[t6])
1978  p.globalReplace("a",new)
1979  p.globalReplace("d",new2)
1980  visitor2 = NodeVisitor()
1981  p.p.visit(visitor2)
1982  self.assertTrue(visitor2.modules == set([new,new2,p.b,p.c]))
1983  visitor3 = NodeVisitor()
1984  p.e3.visit(visitor3)
1985  self.assertTrue(visitor3.modules == set([new,new2,p.b,p.c]))
1986  visitor4 = NodeVisitor()
1987  p.s4.visit(visitor4)
1988  self.assertTrue(visitor4.modules == set([new,new2,p.b]))
1989  visitor5 = NodeVisitor()
1990  p.t1.visit(visitor5)
1991  self.assertTrue(visitor5.modules == set([new2]))
1992  visitor6 = NodeVisitor()
1993  listOfTasks = list(p.schedule._tasks)
1994  listOfTasks[0].visit(visitor6)
1995  self.assertTrue(visitor6.modules == set([new2]))
1996 
def visit(visitdir)
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
def testGlobalReplace(self)
Definition: Config.py:1952
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def Config.TestModuleCommand.testImplicitSchedule (   self)

Definition at line 2453 of file Config.py.

2454  p = Process("test")
2455  p.a = EDAnalyzer("MyAnalyzer")
2456  p.b = EDAnalyzer("YourAnalyzer")
2457  p.c = EDAnalyzer("OurAnalyzer")
2458  p.path1 = Path(p.a)
2459  p.path2 = Path(p.b)
2460  self.assert_(p.schedule is None)
2461  pths = p.paths
2462  keys = pths.keys()
2463  self.assertEqual(pths[keys[0]],p.path1)
2464  self.assertEqual(pths[keys[1]],p.path2)
2465  p.prune()
2466  self.assert_(hasattr(p, 'a'))
2467  self.assert_(hasattr(p, 'b'))
2468  self.assert_(not hasattr(p, 'c'))
2469  self.assert_(hasattr(p, 'path1'))
2470  self.assert_(hasattr(p, 'path2'))
2471 
2472 
2473  p = Process("test")
2474  p.a = EDAnalyzer("MyAnalyzer")
2475  p.b = EDAnalyzer("YourAnalyzer")
2476  p.c = EDAnalyzer("OurAnalyzer")
2477  p.path2 = Path(p.b)
2478  p.path1 = Path(p.a)
2479  self.assert_(p.schedule is None)
2480  pths = p.paths
2481  keys = pths.keys()
2482  self.assertEqual(pths[keys[1]],p.path1)
2483  self.assertEqual(pths[keys[0]],p.path2)
2484 
2485 
def testImplicitSchedule(self)
Definition: Config.py:2453
def Config.TestModuleCommand.testModifier (   self)

Definition at line 2929 of file Config.py.

References cmsPerfStripChart.dict, and resolutioncreator_cfi.object.

2929  def testModifier(self):
2930  m1 = Modifier()
2931  p = Process("test",m1)
2932  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
2933  def _mod_fred(obj):
2934  obj.fred = 2
2935  m1.toModify(p.a,_mod_fred)
2936  self.assertEqual(p.a.fred.value(),2)
2937  p.b = EDAnalyzer("YourAnalyzer", wilma = int32(1))
2938  m1.toModify(p.b, wilma = 2)
2939  self.assertEqual(p.b.wilma.value(),2)
2940  self.assert_(p.isUsingModifier(m1))
2941  #check that Modifier not attached to a process doesn't run
2942  m1 = Modifier()
2943  p = Process("test")
2944  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
2945  m1.toModify(p.a,_mod_fred)
2946  p.b = EDAnalyzer("YourAnalyzer", wilma = int32(1))
2947  m1.toModify(p.b, wilma = 2)
2948  self.assertEqual(p.a.fred.value(),1)
2949  self.assertEqual(p.b.wilma.value(),1)
2950  self.assertEqual(p.isUsingModifier(m1),False)
2951  #make sure clones get the changes
2952  m1 = Modifier()
2953  p = Process("test",m1)
2954  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
2955  m1.toModify(p.a, fred = int32(2))
2956  p.b = p.a.clone(wilma = int32(3))
2957  self.assertEqual(p.a.fred.value(),2)
2958  self.assertEqual(p.a.wilma.value(),1)
2959  self.assertEqual(p.b.fred.value(),2)
2960  self.assertEqual(p.b.wilma.value(),3)
2961  #test removal of parameter
2962  m1 = Modifier()
2963  p = Process("test",m1)
2964  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1), fintstones = PSet(fred = int32(1)))
2965  m1.toModify(p.a, fred = None, fintstones = dict(fred = None))
2966  self.assertEqual(hasattr(p.a, "fred"), False)
2967  self.assertEqual(hasattr(p.a.fintstones, "fred"), False)
2968  self.assertEqual(p.a.wilma.value(),1)
2969  #test adding a parameter
2970  m1 = Modifier()
2971  p = Process("test",m1)
2972  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1))
2973  m1.toModify(p.a, wilma = int32(2))
2974  self.assertEqual(p.a.fred.value(), 1)
2975  self.assertEqual(p.a.wilma.value(),2)
2976  #test setting of value in PSet
2977  m1 = Modifier()
2978  p = Process("test",m1)
2979  p.a = EDAnalyzer("MyAnalyzer", flintstones = PSet(fred = int32(1), wilma = int32(1)))
2980  m1.toModify(p.a, flintstones = dict(fred = int32(2)))
2981  self.assertEqual(p.a.flintstones.fred.value(),2)
2982  self.assertEqual(p.a.flintstones.wilma.value(),1)
2983  #test proper exception from nonexisting parameter name
2984  m1 = Modifier()
2985  p = Process("test",m1)
2986  p.a = EDAnalyzer("MyAnalyzer", flintstones = PSet(fred = PSet(wilma = int32(1))))
2987  self.assertRaises(KeyError, lambda: m1.toModify(p.a, flintstones = dict(imnothere = dict(wilma=2))))
2988  self.assertRaises(KeyError, lambda: m1.toModify(p.a, foo = 1))
2989  #test setting a value in a VPSet
2990  m1 = Modifier()
2991  p = Process("test",m1)
2992  p.a = EDAnalyzer("MyAnalyzer", flintstones = VPSet(PSet(fred = int32(1)), PSet(wilma = int32(1))))
2993  m1.toModify(p.a, flintstones = {1:dict(wilma = int32(2))})
2994  self.assertEqual(p.a.flintstones[0].fred.value(),1)
2995  self.assertEqual(p.a.flintstones[1].wilma.value(),2)
2996  #test setting a value in a list of values
2997  m1 = Modifier()
2998  p = Process("test",m1)
2999  p.a = EDAnalyzer("MyAnalyzer", fred = vuint32(1,2,3))
3000  m1.toModify(p.a, fred = {1:7})
3001  self.assertEqual(p.a.fred[0],1)
3002  self.assertEqual(p.a.fred[1],7)
3003  self.assertEqual(p.a.fred[2],3)
3004  #test IndexError setting a value in a list to an item key not in the list
3005  m1 = Modifier()
3006  p = Process("test",m1)
3007  p.a = EDAnalyzer("MyAnalyzer", fred = vuint32(1,2,3))
3008  raised = False
3009  try: m1.toModify(p.a, fred = {5:7})
3010  except IndexError as e: raised = True
3011  self.assertEqual(raised, True)
3012  #test TypeError setting a value in a list using a key that is not an int
3013  m1 = Modifier()
3014  p = Process("test",m1)
3015  p.a = EDAnalyzer("MyAnalyzer", flintstones = VPSet(PSet(fred = int32(1)), PSet(wilma = int32(1))))
3016  raised = False
3017  try: m1.toModify(p.a, flintstones = dict(bogus = int32(37)))
3018  except TypeError as e: raised = True
3019  self.assertEqual(raised, True)
3020  #test that load causes process wide methods to run
3021  def _rem_a(proc):
3022  del proc.a
3023  class ProcModifierMod(object):
3024  def __init__(self,modifier,func):
3025  self.proc_mod_ = modifier.makeProcessModifier(func)
3026  class DummyMod(object):
3027  def __init__(self):
3028  self.a = EDAnalyzer("Dummy")
3029  testMod = DummyMod()
3030  p.extend(testMod)
3031  self.assert_(hasattr(p,"a"))
3032  m1 = Modifier()
3033  p = Process("test",m1)
3034  testProcMod = ProcModifierMod(m1,_rem_a)
3035  p.extend(testMod)
3036  p.extend(testProcMod)
3037  self.assert_(not hasattr(p,"a"))
3038  #test ModifierChain
3039  m1 = Modifier()
3040  mc = ModifierChain(m1)
3041  p = Process("test",mc)
3042  self.assert_(p.isUsingModifier(m1))
3043  self.assert_(p.isUsingModifier(mc))
3044  testMod = DummyMod()
3045  p.b = EDAnalyzer("Dummy2", fred = int32(1))
3046  m1.toModify(p.b, fred = int32(3))
3047  p.extend(testMod)
3048  testProcMod = ProcModifierMod(m1,_rem_a)
3049  p.extend(testProcMod)
3050  self.assert_(not hasattr(p,"a"))
3051  self.assertEqual(p.b.fred.value(),3)
3052  #check cloneAndExclude
3053  m1 = Modifier()
3054  m2 = Modifier()
3055  mc = ModifierChain(m1,m2)
3056  mclone = mc.copyAndExclude([m2])
3057  self.assert_(not mclone._isOrContains(m2))
3058  self.assert_(mclone._isOrContains(m1))
3059  m3 = Modifier()
3060  mc2 = ModifierChain(mc,m3)
3061  mclone = mc2.copyAndExclude([m2])
3062  self.assert_(not mclone._isOrContains(m2))
3063  self.assert_(mclone._isOrContains(m1))
3064  self.assert_(mclone._isOrContains(m3))
3065  #check combining
3066  m1 = Modifier()
3067  m2 = Modifier()
3068  p = Process("test",m1)
3069  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3070  (m1 & m2).toModify(p.a, fred = int32(2))
3071  self.assertRaises(TypeError, lambda: (m1 & m2).toModify(p.a, 1, wilma=2))
3072  self.assertEqual(p.a.fred, 1)
3073  m1 = Modifier()
3074  m2 = Modifier()
3075  p = Process("test",m1,m2)
3076  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3077  (m1 & m2).toModify(p.a, fred = int32(2))
3078  self.assertEqual(p.a.fred, 2)
3079  m1 = Modifier()
3080  m2 = Modifier()
3081  m3 = Modifier()
3082  p = Process("test",m1,m2,m3)
3083  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3084  (m1 & m2 & m3).toModify(p.a, fred = int32(2))
3085  self.assertEqual(p.a.fred, 2)
3086  (m1 & (m2 & m3)).toModify(p.a, fred = int32(3))
3087  self.assertEqual(p.a.fred, 3)
3088  ((m1 & m2) & m3).toModify(p.a, fred = int32(4))
3089  self.assertEqual(p.a.fred, 4)
3090  #check inverse
3091  m1 = Modifier()
3092  m2 = Modifier()
3093  p = Process("test", m1)
3094  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3095  (~m1).toModify(p.a, fred=2)
3096  self.assertEqual(p.a.fred, 1)
3097  (~m2).toModify(p.a, wilma=2)
3098  self.assertEqual(p.a.wilma, 2)
3099  self.assertRaises(TypeError, lambda: (~m1).toModify(p.a, 1, wilma=2))
3100  self.assertRaises(TypeError, lambda: (~m2).toModify(p.a, 1, wilma=2))
3101  # check or
3102  m1 = Modifier()
3103  m2 = Modifier()
3104  m3 = Modifier()
3105  p = Process("test", m1)
3106  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3107  (m1 | m2).toModify(p.a, fred=2)
3108  self.assertEqual(p.a.fred, 2)
3109  (m1 | m2 | m3).toModify(p.a, fred=3)
3110  self.assertEqual(p.a.fred, 3)
3111  (m3 | m2 | m1).toModify(p.a, fred=4)
3112  self.assertEqual(p.a.fred, 4)
3113  ((m1 | m2) | m3).toModify(p.a, fred=5)
3114  self.assertEqual(p.a.fred, 5)
3115  (m1 | (m2 | m3)).toModify(p.a, fred=6)
3116  self.assertEqual(p.a.fred, 6)
3117  (m2 | m3).toModify(p.a, fred=7)
3118  self.assertEqual(p.a.fred, 6)
3119  self.assertRaises(TypeError, lambda: (m1 | m2).toModify(p.a, 1, wilma=2))
3120  self.assertRaises(TypeError, lambda: (m2 | m3).toModify(p.a, 1, wilma=2))
3121  # check combinations
3122  m1 = Modifier()
3123  m2 = Modifier()
3124  m3 = Modifier()
3125  m4 = Modifier()
3126  p = Process("test", m1, m2)
3127  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3128  (m1 & ~m2).toModify(p.a, fred=2)
3129  self.assertEqual(p.a.fred, 1)
3130  (m1 & ~m3).toModify(p.a, fred=2)
3131  self.assertEqual(p.a.fred, 2)
3132  (m1 | ~m2).toModify(p.a, fred=3)
3133  self.assertEqual(p.a.fred, 3)
3134  (~m1 | ~m2).toModify(p.a, fred=4)
3135  self.assertEqual(p.a.fred, 3)
3136  (~m3 & ~m4).toModify(p.a, fred=4)
3137  self.assertEqual(p.a.fred, 4)
3138  ((m1 & m3) | ~m4).toModify(p.a, fred=5)
3139  self.assertEqual(p.a.fred, 5)
3140  #check toReplaceWith
3141  m1 = Modifier()
3142  p = Process("test",m1)
3143  p.a =EDAnalyzer("MyAnalyzer", fred = int32(1))
3144  m1.toReplaceWith(p.a, EDAnalyzer("YourAnalyzer", wilma = int32(3)))
3145  self.assertRaises(TypeError, lambda: m1.toReplaceWith(p.a, EDProducer("YourProducer")))
3146  p.b =EDAnalyzer("BAn")
3147  p.c =EDProducer("c")
3148  p.d =EDProducer("d")
3149  p.tc = Task(p.c)
3150  p.td = Task(p.d)
3151  p.s = Sequence(p.a, p.tc)
3152  m1.toReplaceWith(p.s, Sequence(p.a+p.b, p.td))
3153  self.assertEqual(p.a.wilma.value(),3)
3154  self.assertEqual(p.a.type_(),"YourAnalyzer")
3155  self.assertEqual(hasattr(p,"fred"),False)
3156  self.assertTrue(p.s.dumpPython("") == "cms.Sequence(process.a+process.b, process.td)\n")
3157  p.e =EDProducer("e")
3158  m1.toReplaceWith(p.td, Task(p.e))
3159  self.assertTrue(p.td._collection == OrderedSet([p.e]))
3160  #check toReplaceWith doesn't activate not chosen
3161  m1 = Modifier()
3162  p = Process("test")
3163  p.a =EDAnalyzer("MyAnalyzer", fred = int32(1))
3164  m1.toReplaceWith(p.a, EDAnalyzer("YourAnalyzer", wilma = int32(3)))
3165  self.assertEqual(p.a.type_(),"MyAnalyzer")
3166  #check toReplaceWith and and/not/or combinations
3167  m1 = Modifier()
3168  m2 = Modifier()
3169  m3 = Modifier()
3170  m4 = Modifier()
3171  p = Process("test", m1, m2)
3172  p.a = EDAnalyzer("MyAnalyzer", fred = int32(1), wilma = int32(1))
3173  self.assertRaises(TypeError, lambda: (m1 & m2).toReplaceWith(p.a, EDProducer("YourProducer")))
3174  self.assertRaises(TypeError, lambda: (m3 & m4).toReplaceWith(p.a, EDProducer("YourProducer")))
3175  self.assertRaises(TypeError, lambda: (~m3).toReplaceWith(p.a, EDProducer("YourProducer")))
3176  self.assertRaises(TypeError, lambda: (~m1).toReplaceWith(p.a, EDProducer("YourProducer")))
3177  self.assertRaises(TypeError, lambda: (m1 | m3).toReplaceWith(p.a, EDProducer("YourProducer")))
3178  self.assertRaises(TypeError, lambda: (m3 | m4).toReplaceWith(p.a, EDProducer("YourProducer")))
3179  (m1 & m2).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer1"))
3180  self.assertEqual(p.a.type_(), "YourAnalyzer1")
3181  (m1 & m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
3182  self.assertEqual(p.a.type_(), "YourAnalyzer1")
3183  (~m1).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
3184  self.assertEqual(p.a.type_(), "YourAnalyzer1")
3185  (~m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer2"))
3186  self.assertEqual(p.a.type_(), "YourAnalyzer2")
3187  (m1 | m3).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer3"))
3188  self.assertEqual(p.a.type_(), "YourAnalyzer3")
3189  (m3 | m4).toReplaceWith(p.a, EDAnalyzer("YourAnalyzer4"))
3190  self.assertEqual(p.a.type_(), "YourAnalyzer3")
3191  unittest.main()
def testModifier(self)
Definition: Config.py:2929
def Config.TestModuleCommand.testOverride (   self)

Definition at line 2493 of file Config.py.

2493  def testOverride(self):
2494  p = Process('test')
2495  a = EDProducer("A", a1=int32(0))
2496  self.assert_(not a.isModified())
2497  a.a1 = 1
2498  self.assert_(a.isModified())
2499  p.a = a
2500  self.assertEqual(p.a.a1.value(), 1)
2501  # try adding an unmodified module.
2502  # should accept it
2503  p.a = EDProducer("A", a1=int32(2))
2504  self.assertEqual(p.a.a1.value(), 2)
2505  # try adding a modified module. Should throw
2506  # no longer, since the same (modified) say, geometry
2507  # could come from more than one cff
2508  b = EDProducer("A", a1=int32(3))
2509  b.a1 = 4
2510  #self.assertRaises(RuntimeError, setattr, *(p,'a',b))
2511  ps1 = PSet(a = int32(1))
2512  ps2 = PSet(a = int32(2))
2513  self.assertRaises(ValueError, EDProducer, 'C', ps1, ps2)
2514  self.assertRaises(ValueError, EDProducer, 'C', ps1, a=int32(3))
2515 
def testOverride(self)
Definition: Config.py:2493
def Config.TestModuleCommand.testParameterizable (   self)

Definition at line 1557 of file Config.py.

1558  p = _Parameterizable()
1559  self.assertEqual(len(p.parameterNames_()),0)
1560  p.a = int32(1)
1561  self.assert_('a' in p.parameterNames_())
1562  self.assertEqual(p.a.value(), 1)
1563  p.a = 10
1564  self.assertEqual(p.a.value(), 10)
1565  p.a = untracked(int32(1))
1566  self.assertEqual(p.a.value(), 1)
1567  self.failIf(p.a.isTracked())
1568  p.a = untracked.int32(1)
1569  self.assertEqual(p.a.value(), 1)
1570  self.failIf(p.a.isTracked())
1571  p = _Parameterizable(foo=int32(10), bar = untracked(double(1.0)))
1572  self.assertEqual(p.foo.value(), 10)
1573  self.assertEqual(p.bar.value(),1.0)
1574  self.failIf(p.bar.isTracked())
1575  self.assertRaises(TypeError,setattr,(p,'c',1))
1576  p = _Parameterizable(a=PSet(foo=int32(10), bar = untracked(double(1.0))))
1577  self.assertEqual(p.a.foo.value(),10)
1578  self.assertEqual(p.a.bar.value(),1.0)
1579  p.b = untracked(PSet(fii = int32(1)))
1580  self.assertEqual(p.b.fii.value(),1)
1581  self.failIf(p.b.isTracked())
1582  #test the fact that values can be shared
1583  v = int32(10)
1584  p=_Parameterizable(a=v)
1585  v.setValue(11)
1586  self.assertEqual(p.a.value(),11)
1587  p.a = 12
1588  self.assertEqual(p.a.value(),12)
1589  self.assertEqual(v.value(),12)
def testParameterizable(self)
Definition: Config.py:1557
def Config.TestModuleCommand.testPath (   self)

Definition at line 2234 of file Config.py.

References SequenceTypes.ignore(), and str.

2234  def testPath(self):
2235  p = Process("test")
2236  p.a = EDAnalyzer("MyAnalyzer")
2237  p.b = EDAnalyzer("YourAnalyzer")
2238  p.c = EDAnalyzer("OurAnalyzer")
2239  path = Path(p.a)
2240  path *= p.b
2241  path += p.c
2242  self.assertEqual(str(path),'a+b+c')
2243  path = Path(p.a*p.b+p.c)
2244  self.assertEqual(str(path),'a+b+c')
2245 # path = Path(p.a)*p.b+p.c #This leads to problems with sequences
2246 # self.assertEqual(str(path),'((a*b)+c)')
2247  path = Path(p.a+ p.b*p.c)
2248  self.assertEqual(str(path),'a+b+c')
2249  path = Path(p.a*(p.b+p.c))
2250  self.assertEqual(str(path),'a+b+c')
2251  path = Path(p.a*(p.b+~p.c))
2252  pathx = Path(p.a*(p.b+ignore(p.c)))
2253  self.assertEqual(str(path),'a+b+~c')
2254  p.es = ESProducer("AnESProducer")
2255  self.assertRaises(TypeError,Path,p.es)
2256 
2257  t = Path()
2258  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path()\n')
2259 
2260  t = Path(p.a)
2261  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path(process.a)\n')
2262 
2263  t = Path(Task())
2264  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path(cms.Task())\n')
2265 
2266  t = Path(p.a, Task())
2267  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path(process.a, cms.Task())\n')
2268 
2269  p.prod = EDProducer("prodName")
2270  p.t1 = Task(p.prod)
2271  t = Path(p.a, p.t1, Task(), p.t1)
2272  self.assertTrue(t.dumpPython(PrintOptions()) == 'cms.Path(process.a, cms.Task(), process.t1)\n')
2273 
def ignore(seq)
#define str(s)
def Config.TestModuleCommand.testPrefers (   self)

Definition at line 2528 of file Config.py.

2528  def testPrefers(self):
2529  p = Process("Test")
2530  p.add_(ESSource("ForceSource"))
2531  p.juicer = ESProducer("JuicerProducer")
2532  p.prefer("ForceSource")
2533  p.prefer("juicer")
2534  self.assertEqual(p.dumpConfig(),
2535 """process Test = {
2536  es_module juicer = JuicerProducer {
2537  }
2538  es_source = ForceSource {
2539  }
2540  es_prefer = ForceSource {
2541  }
2542  es_prefer juicer = JuicerProducer {
2543  }
2544 }
2545 """)
2546  p.prefer("juicer",fooRcd=vstring("Foo"))
2547  self.assertEqual(p.dumpConfig(),
2548 """process Test = {
2549  es_module juicer = JuicerProducer {
2550  }
2551  es_source = ForceSource {
2552  }
2553  es_prefer = ForceSource {
2554  }
2555  es_prefer juicer = JuicerProducer {
2556  vstring fooRcd = {
2557  'Foo'
2558  }
2559 
2560  }
2561 }
2562 """)
2563  self.assertEqual(p.dumpPython(),
2564 """import FWCore.ParameterSet.Config as cms
2565 
2566 process = cms.Process("Test")
2567 
2568 process.juicer = cms.ESProducer("JuicerProducer")
2569 
2570 
2571 process.ForceSource = cms.ESSource("ForceSource")
2572 
2573 
2574 process.prefer("ForceSource")
2575 
2576 process.prefer("juicer",
2577  fooRcd = cms.vstring('Foo')
2578 )
2579 
2580 """)
2581 
def Config.TestModuleCommand.testProcessDumpPython (   self)

Definition at line 1692 of file Config.py.

1693  p = Process("test")
1694  p.a = EDAnalyzer("MyAnalyzer")
1695  p.p = Path(p.a)
1696  p.s = Sequence(p.a)
1697  p.r = Sequence(p.s)
1698  p.p2 = Path(p.s)
1699  p.schedule = Schedule(p.p2,p.p)
1700  d=p.dumpPython()
1701  self.assertEqual(d,
1702 """import FWCore.ParameterSet.Config as cms
1703 
1704 process = cms.Process("test")
1705 
1706 process.a = cms.EDAnalyzer("MyAnalyzer")
1707 
1708 
1709 process.s = cms.Sequence(process.a)
1710 
1711 
1712 process.r = cms.Sequence(process.s)
1713 
1714 
1715 process.p = cms.Path(process.a)
1716 
1717 
1718 process.p2 = cms.Path(process.s)
1719 
1720 
1721 process.schedule = cms.Schedule(*[ process.p2, process.p ])
1722 """)
1723  #Reverse order of 'r' and 's'
1724  p = Process("test")
1725  p.a = EDAnalyzer("MyAnalyzer")
1726  p.p = Path(p.a)
1727  p.r = Sequence(p.a)
1728  p.s = Sequence(p.r)
1729  p.p2 = Path(p.r)
1730  p.schedule = Schedule(p.p2,p.p)
1731  p.b = EDAnalyzer("YourAnalyzer")
1732  d=p.dumpPython()
1733  self.assertEqual(d,
1734 """import FWCore.ParameterSet.Config as cms
1735 
1736 process = cms.Process("test")
1737 
1738 process.a = cms.EDAnalyzer("MyAnalyzer")
1739 
1740 
1741 process.b = cms.EDAnalyzer("YourAnalyzer")
1742 
1743 
1744 process.r = cms.Sequence(process.a)
1745 
1746 
1747 process.s = cms.Sequence(process.r)
1748 
1749 
1750 process.p = cms.Path(process.a)
1751 
1752 
1753 process.p2 = cms.Path(process.r)
1754 
1755 
1756 process.schedule = cms.Schedule(*[ process.p2, process.p ])
1757 """)
def testProcessDumpPython(self)
Definition: Config.py:1692
def Config.TestModuleCommand.testProcessExtend (   self)

Definition at line 1622 of file Config.py.

References resolutioncreator_cfi.object, and str.

1623  class FromArg(object):
1624  def __init__(self,*arg,**args):
1625  for name in args.iterkeys():
1626  self.__dict__[name]=args[name]
1627 
1628  a=EDAnalyzer("MyAnalyzer")
1629  t=EDAnalyzer("MyAnalyzer")
1630  t.setLabel("foo")
1631  s1 = Sequence(a)
1632  s2 = Sequence(s1)
1633  s3 = Sequence(s2)
1634  d = FromArg(
1635  a=a,
1636  b=Service("Full"),
1637  c=Path(a),
1638  d=s2,
1639  e=s1,
1640  f=s3,
1641  g=Sequence(s1+s2+s3)
1642  )
1643  p = Process("Test")
1644  p.extend(d)
1645  self.assertEqual(p.a.type_(),"MyAnalyzer")
1646  self.assertEqual(p.a.label_(),"a")
1647  self.assertRaises(AttributeError,getattr,p,'b')
1648  self.assertEqual(p.Full.type_(),"Full")
1649  self.assertEqual(str(p.c),'a')
1650  self.assertEqual(str(p.d),'a')
1651 
1652  z1 = FromArg(
1653  a=a,
1654  b=Service("Full"),
1655  c=Path(a),
1656  d=s2,
1657  e=s1,
1658  f=s3,
1659  s4=s3,
1660  g=Sequence(s1+s2+s3)
1661  )
1662 
1663  p1 = Process("Test")
1664  #p1.extend(z1)
1665  self.assertRaises(ValueError, p1.extend, z1)
1666 
1667  z2 = FromArg(
1668  a=a,
1669  b=Service("Full"),
1670  c=Path(a),
1671  d=s2,
1672  e=s1,
1673  f=s3,
1674  aaa=copy.deepcopy(a),
1675  s4=copy.deepcopy(s3),
1676  g=Sequence(s1+s2+s3),
1677  t=t
1678  )
1679  p2 = Process("Test")
1680  p2.extend(z2)
1681  #self.assertRaises(ValueError, p2.extend, z2)
1682  self.assertEqual(p2.s4.label_(),"s4")
1683  #p2.s4.setLabel("foo")
1684  self.assertRaises(ValueError, p2.s4.setLabel, "foo")
1685  p2.s4.setLabel("s4")
1686  p2.s4.setLabel(None)
1687  p2.s4.setLabel("foo")
1688  p2._Process__setObjectLabel(p2.s4, "foo")
1689  p2._Process__setObjectLabel(p2.s4, None)
1690  p2._Process__setObjectLabel(p2.s4, "bar")
1691 
def testProcessExtend(self)
Definition: Config.py:1622
#define str(s)
def Config.TestModuleCommand.testProcessInsertion (   self)

Definition at line 1597 of file Config.py.

1598  p = Process("test")
1599  p.a = EDAnalyzer("MyAnalyzer")
1600  self.assert_( 'a' in p.analyzers_() )
1601  self.assert_( 'a' in p.analyzers)
1602  p.add_(Service("MessageLogger"))
1603  self.assert_('MessageLogger' in p.services_())
1604  self.assertEqual(p.MessageLogger.type_(), "MessageLogger")
1605  p.Tracer = Service("Tracer")
1606  self.assert_('Tracer' in p.services_())
1607  self.assertRaises(TypeError, setattr, *(p,'b',"this should fail"))
1608  self.assertRaises(TypeError, setattr, *(p,'bad',Service("MessageLogger")))
1609  self.assertRaises(ValueError, setattr, *(p,'bad',Source("PoolSource")))
1610  p.out = OutputModule("Outer")
1611  self.assertEqual(p.out.type_(), 'Outer')
1612  self.assert_( 'out' in p.outputModules_() )
1613 
1614  p.geom = ESSource("GeomProd")
1615  self.assert_('geom' in p.es_sources_())
1616  p.add_(ESSource("ConfigDB"))
1617  self.assert_('ConfigDB' in p.es_sources_())
1618 
1619  p.aliasfoo1 = EDAlias(foo1 = VPSet(PSet(type = string("Foo1"))))
1620  self.assert_('aliasfoo1' in p.aliases_())
1621 
def testProcessInsertion(self)
Definition: Config.py:1597
def Config.TestModuleCommand.testPrune (   self)

Definition at line 2656 of file Config.py.

2656  def testPrune(self):
2657  p = Process("test")
2658  p.a = EDAnalyzer("MyAnalyzer")
2659  p.b = EDAnalyzer("YourAnalyzer")
2660  p.c = EDAnalyzer("OurAnalyzer")
2661  p.d = EDAnalyzer("OurAnalyzer")
2662  p.s = Sequence(p.d)
2663  p.path1 = Path(p.a)
2664  p.path2 = Path(p.b)
2665  self.assert_(p.schedule is None)
2666  pths = p.paths
2667  keys = pths.keys()
2668  self.assertEqual(pths[keys[0]],p.path1)
2669  self.assertEqual(pths[keys[1]],p.path2)
2670  p.pset1 = PSet(parA = string("pset1"))
2671  p.pset2 = untracked.PSet(parA = string("pset2"))
2672  p.vpset1 = VPSet()
2673  p.vpset2 = untracked.VPSet()
2674  p.prune()
2675  self.assert_(hasattr(p, 'a'))
2676  self.assert_(hasattr(p, 'b'))
2677  self.assert_(not hasattr(p, 'c'))
2678  self.assert_(not hasattr(p, 'd'))
2679  self.assert_(not hasattr(p, 's'))
2680  self.assert_(hasattr(p, 'path1'))
2681  self.assert_(hasattr(p, 'path2'))
2682 # self.assert_(not hasattr(p, 'pset1'))
2683 # self.assert_(hasattr(p, 'pset2'))
2684 # self.assert_(not hasattr(p, 'vpset1'))
2685 # self.assert_(not hasattr(p, 'vpset2'))
2686 
2687  p = Process("test")
2688  p.a = EDAnalyzer("MyAnalyzer")
2689  p.b = EDAnalyzer("YourAnalyzer")
2690  p.c = EDAnalyzer("OurAnalyzer")
2691  p.d = EDAnalyzer("OurAnalyzer")
2692  p.e = EDAnalyzer("OurAnalyzer")
2693  p.s = Sequence(p.d)
2694  p.s2 = Sequence(p.b)
2695  p.s3 = Sequence(p.e)
2696  p.path1 = Path(p.a)
2697  p.path2 = Path(p.b)
2698  p.path3 = Path(p.b+p.s2)
2699  p.path4 = Path(p.b+p.s3)
2700  p.schedule = Schedule(p.path1,p.path2,p.path3)
2701  pths = p.paths
2702  keys = pths.keys()
2703  self.assertEqual(pths[keys[0]],p.path1)
2704  self.assertEqual(pths[keys[1]],p.path2)
2705  p.prune()
2706  self.assert_(hasattr(p, 'a'))
2707  self.assert_(hasattr(p, 'b'))
2708  self.assert_(not hasattr(p, 'c'))
2709  self.assert_(not hasattr(p, 'd'))
2710  self.assert_(not hasattr(p, 'e'))
2711  self.assert_(not hasattr(p, 's'))
2712  self.assert_(hasattr(p, 's2'))
2713  self.assert_(not hasattr(p, 's3'))
2714  self.assert_(hasattr(p, 'path1'))
2715  self.assert_(hasattr(p, 'path2'))
2716  self.assert_(hasattr(p, 'path3'))
2717  self.assert_(not hasattr(p, 'path4'))
2718  #test SequencePlaceholder
2719  p = Process("test")
2720  p.a = EDAnalyzer("MyAnalyzer")
2721  p.b = EDAnalyzer("YourAnalyzer")
2722  p.s = Sequence(SequencePlaceholder("a")+p.b)
2723  p.pth = Path(p.s)
2724  p.prune()
2725  self.assert_(hasattr(p, 'a'))
2726  self.assert_(hasattr(p, 'b'))
2727  self.assert_(hasattr(p, 's'))
2728  self.assert_(hasattr(p, 'pth'))
2729  #test unresolved SequencePlaceholder
2730  p = Process("test")
2731  p.b = EDAnalyzer("YourAnalyzer")
2732  p.s = Sequence(SequencePlaceholder("a")+p.b)
2733  p.pth = Path(p.s)
2734  p.prune(keepUnresolvedSequencePlaceholders=True)
2735  self.assert_(hasattr(p, 'b'))
2736  self.assert_(hasattr(p, 's'))
2737  self.assert_(hasattr(p, 'pth'))
2738  self.assertEqual(p.s.dumpPython(''),'cms.Sequence(cms.SequencePlaceholder("a")+process.b)\n')
def Config.TestModuleCommand.testRefToPSet (   self)

Definition at line 2640 of file Config.py.

2640  def testRefToPSet(self):
2641  proc = Process("test")
2642  proc.top = PSet(a = int32(1))
2643  proc.ref = PSet(refToPSet_ = string("top"))
2644  proc.ref2 = PSet( a = int32(1), b = PSet( refToPSet_ = string("top")))
2645  proc.ref3 = PSet(refToPSet_ = string("ref"))
2646  proc.ref4 = VPSet(PSet(refToPSet_ = string("top")),
2647  PSet(refToPSet_ = string("ref2")))
2648  p = TestMakePSet()
2649  proc.fillProcessDesc(p)
2650  self.assertEqual((True,1),p.values["ref"][1].values["a"])
2651  self.assertEqual((True,1),p.values["ref3"][1].values["a"])
2652  self.assertEqual((True,1),p.values["ref2"][1].values["a"])
2653  self.assertEqual((True,1),p.values["ref2"][1].values["b"][1].values["a"])
2654  self.assertEqual((True,1),p.values["ref4"][1][0].values["a"])
2655  self.assertEqual((True,1),p.values["ref4"][1][1].values["a"])
def testRefToPSet(self)
Definition: Config.py:2640
def Config.TestModuleCommand.testSchedule (   self)

Definition at line 2348 of file Config.py.

References list().

2348  def testSchedule(self):
2349  p = Process("test")
2350  p.a = EDAnalyzer("MyAnalyzer")
2351  p.b = EDAnalyzer("YourAnalyzer")
2352  p.c = EDAnalyzer("OurAnalyzer")
2353  p.d = EDAnalyzer("OurAnalyzer")
2354  p.path1 = Path(p.a)
2355  p.path2 = Path(p.b)
2356  p.path3 = Path(p.d)
2357 
2358  s = Schedule(p.path1,p.path2)
2359  self.assertEqual(s[0],p.path1)
2360  self.assertEqual(s[1],p.path2)
2361  p.schedule = s
2362  self.assert_('b' in p.schedule.moduleNames())
2363  self.assert_(hasattr(p, 'b'))
2364  self.assert_(hasattr(p, 'c'))
2365  self.assert_(hasattr(p, 'd'))
2366  self.assert_(hasattr(p, 'path1'))
2367  self.assert_(hasattr(p, 'path2'))
2368  self.assert_(hasattr(p, 'path3'))
2369  p.prune()
2370  self.assert_('b' in p.schedule.moduleNames())
2371  self.assert_(hasattr(p, 'b'))
2372  self.assert_(not hasattr(p, 'c'))
2373  self.assert_(not hasattr(p, 'd'))
2374  self.assert_(hasattr(p, 'path1'))
2375  self.assert_(hasattr(p, 'path2'))
2376  self.assert_(not hasattr(p, 'path3'))
2377 
2378  self.assertTrue(len(p.schedule._tasks) == 0)
2379 
2380  p = Process("test")
2381  p.a = EDAnalyzer("MyAnalyzer")
2382  p.b = EDAnalyzer("YourAnalyzer")
2383  p.c = EDAnalyzer("OurAnalyzer")
2384  p.d = EDAnalyzer("dAnalyzer")
2385  p.e = EDProducer("eProducer")
2386  p.f = EDProducer("fProducer")
2387  p.Tracer = Service("Tracer")
2388  p.path1 = Path(p.a)
2389  p.path2 = Path(p.b)
2390  p.path3 = Path(p.d)
2391  p.task1 = Task(p.e)
2392  p.task2 = Task(p.f, p.Tracer)
2393  s = Schedule(p.path1,p.path2,tasks=[p.task1,p.task2,p.task1])
2394  self.assertEqual(s[0],p.path1)
2395  self.assertEqual(s[1],p.path2)
2396  self.assertTrue(len(s._tasks) == 2)
2397  self.assertTrue(p.task1 in s._tasks)
2398  self.assertTrue(p.task2 in s._tasks)
2399  listOfTasks = list(s._tasks)
2400  self.assertTrue(len(listOfTasks) == 2)
2401  self.assertTrue(p.task1 == listOfTasks[0])
2402  self.assertTrue(p.task2 == listOfTasks[1])
2403  p.schedule = s
2404  self.assert_('b' in p.schedule.moduleNames())
2405 
2406  process2 = Process("test")
2407  process2.a = EDAnalyzer("MyAnalyzer")
2408  process2.e = EDProducer("eProducer")
2409  process2.path1 = Path(process2.a)
2410  process2.task1 = Task(process2.e)
2411  process2.schedule = Schedule(process2.path1,tasks=process2.task1)
2412  listOfTasks = list(process2.schedule._tasks)
2413  self.assertTrue(listOfTasks[0] == process2.task1)
2414 
2415  # test Schedule copy
2416  s2 = s.copy()
2417  self.assertEqual(s2[0],p.path1)
2418  self.assertEqual(s2[1],p.path2)
2419  self.assertTrue(len(s2._tasks) == 2)
2420  self.assertTrue(p.task1 in s2._tasks)
2421  self.assertTrue(p.task2 in s2._tasks)
2422  listOfTasks = list(s2._tasks)
2423  self.assertTrue(len(listOfTasks) == 2)
2424  self.assertTrue(p.task1 == listOfTasks[0])
2425  self.assertTrue(p.task2 == listOfTasks[1])
2426 
2427  names = s.moduleNames()
2428  self.assertTrue(names == set(['a', 'b', 'e', 'Tracer', 'f']))
2429  #adding a path not attached to the Process should cause an exception
2430  p = Process("test")
2431  p.a = EDAnalyzer("MyAnalyzer")
2432  path1 = Path(p.a)
2433  s = Schedule(path1)
2434  self.assertRaises(RuntimeError, lambda : p.setSchedule_(s) )
2435 
2436  #make sure anonymous sequences work
2437  p = Process("test")
2438  p.a = EDAnalyzer("MyAnalyzer")
2439  p.b = EDAnalyzer("MyOtherAnalyzer")
2440  p.c = EDProducer("MyProd")
2441  path1 = Path(p.c*Sequence(p.a+p.b))
2442  s = Schedule(path1)
2443  self.assert_('a' in s.moduleNames())
2444  self.assert_('b' in s.moduleNames())
2445  self.assert_('c' in s.moduleNames())
2446  p.path1 = path1
2447  p.schedule = s
2448  p.prune()
2449  self.assert_('a' in s.moduleNames())
2450  self.assert_('b' in s.moduleNames())
2451  self.assert_('c' in s.moduleNames())
2452 
def testSchedule(self)
Definition: Config.py:2348
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def Config.TestModuleCommand.testSecSource (   self)

Definition at line 1947 of file Config.py.

References python.rootplot.root2matplotlib.replace().

1947  def testSecSource(self):
1948  p = Process('test')
1949  p.a = SecSource("MySecSource")
1950  self.assertEqual(p.dumpPython().replace('\n',''),'import FWCore.ParameterSet.Config as cmsprocess = cms.Process("test")process.a = cms.SecSource("MySecSource")')
1951 
def replace(string, replacements)
def testSecSource(self)
Definition: Config.py:1947
def Config.TestModuleCommand.testSequence (   self)

Definition at line 1997 of file Config.py.

References str.

1997  def testSequence(self):
1998  p = Process('test')
1999  p.a = EDAnalyzer("MyAnalyzer")
2000  p.b = EDAnalyzer("YourAnalyzer")
2001  p.c = EDAnalyzer("OurAnalyzer")
2002  p.s = Sequence(p.a*p.b)
2003  self.assertEqual(str(p.s),'a+b')
2004  self.assertEqual(p.s.label_(),'s')
2005  path = Path(p.c+p.s)
2006  self.assertEqual(str(path),'c+a+b')
2007  p._validateSequence(path, 'p1')
2008  notInProcess = EDAnalyzer('NotInProcess')
2009  p2 = Path(p.c+p.s*notInProcess)
2010  self.assertRaises(RuntimeError, p._validateSequence, p2, 'p2')
2011 
def testSequence(self)
Definition: Config.py:1997
#define str(s)
def Config.TestModuleCommand.testSequence2 (   self)

Definition at line 2012 of file Config.py.

2012  def testSequence2(self):
2013  p = Process('test')
2014  p.a = EDAnalyzer("MyAnalyzer")
2015  p.b = EDAnalyzer("YourAnalyzer")
2016  p.c = EDAnalyzer("OurAnalyzer")
2017  testseq = Sequence(p.a*p.b)
2018  p.s = testseq
2019  #p.y = testseq
2020  self.assertRaises(ValueError, p.__setattr__, "y", testseq)
2021 
def testSequence2(self)
Definition: Config.py:2012
def Config.TestModuleCommand.testServiceInProcess (   self)

Definition at line 2022 of file Config.py.

2023  service = Service("d")
2024  self.assertFalse(service._inProcess)
2025  process = Process("test")
2026  process.d = service
2027  self.assertTrue(service._inProcess)
2028  service2 = Service("d")
2029  process.d = service2
2030  self.assertFalse(service._inProcess)
2031  self.assertTrue(service2._inProcess)
2032  del process.d
2033  self.assertFalse(service2._inProcess)
2034 
def testServiceInProcess(self)
Definition: Config.py:2022
def Config.TestModuleCommand.testSubProcess (   self)

Definition at line 2600 of file Config.py.

References cond.hash, and str.

2600  def testSubProcess(self):
2601  process = Process("Parent")
2602  subProcess = Process("Child")
2603  subProcess.a = EDProducer("A")
2604  subProcess.p = Path(subProcess.a)
2605  subProcess.add_(Service("Foo"))
2606  process.addSubProcess(SubProcess(subProcess))
2607  d = process.dumpPython()
2608  equalD ="""import FWCore.ParameterSet.Config as cms
2609 
2610 process = cms.Process("Parent")
2611 
2612 parentProcess = process
2613 import FWCore.ParameterSet.Config as cms
2614 
2615 process = cms.Process("Child")
2616 
2617 process.a = cms.EDProducer("A")
2618 
2619 
2620 process.Foo = cms.Service("Foo")
2621 
2622 
2623 process.p = cms.Path(process.a)
2624 
2625 
2626 childProcess = process
2627 process = parentProcess
2628 process.addSubProcess(cms.SubProcess(process = childProcess, SelectEvents = cms.untracked.PSet(
2629 
2630 ), outputCommands = cms.untracked.vstring()))
2631 
2632 """
2633  equalD = equalD.replace("parentProcess","parentProcess"+str(hash(process.subProcesses_()[0])))
2634  self.assertEqual(d,equalD)
2635  p = TestMakePSet()
2636  process.fillProcessDesc(p)
2637  self.assertEqual((True,['a']),p.values["subProcesses"][1][0].values["process"][1].values['@all_modules'])
2638  self.assertEqual((True,['p']),p.values["subProcesses"][1][0].values["process"][1].values['@paths'])
2639  self.assertEqual({'@service_type':(True,'Foo')}, p.values["subProcesses"][1][0].values["process"][1].values["services"][1][0].values)
def testSubProcess(self)
Definition: Config.py:2600
#define str(s)
def Config.TestModuleCommand.testTask (   self)

Definition at line 2035 of file Config.py.

References list().

2035  def testTask(self):
2036 
2037  # create some objects to use in tests
2038  edanalyzer = EDAnalyzer("a")
2039  edproducer = EDProducer("b")
2040  edproducer2 = EDProducer("b2")
2041  edproducer3 = EDProducer("b3")
2042  edproducer4 = EDProducer("b4")
2043  edproducer8 = EDProducer("b8")
2044  edproducer9 = EDProducer("b9")
2045  edfilter = EDFilter("c")
2046  service = Service("d")
2047  service3 = Service("d")
2048  essource = ESSource("e")
2049  esproducer = ESProducer("f")
2050  testTask2 = Task()
2051 
2052  # test adding things to Tasks
2053  testTask1 = Task(edproducer, edfilter)
2054  self.assertRaises(RuntimeError, testTask1.add, edanalyzer)
2055  testTask1.add(essource, service)
2056  testTask1.add(essource, esproducer)
2057  testTask1.add(testTask2)
2058  coll = testTask1._collection
2059  self.assertTrue(edproducer in coll)
2060  self.assertTrue(edfilter in coll)
2061  self.assertTrue(service in coll)
2062  self.assertTrue(essource in coll)
2063  self.assertTrue(esproducer in coll)
2064  self.assertTrue(testTask2 in coll)
2065  self.assertTrue(len(coll) == 6)
2066  self.assertTrue(len(testTask2._collection) == 0)
2067 
2068  taskContents = []
2069  for i in testTask1:
2070  taskContents.append(i)
2071  self.assertTrue(taskContents == [edproducer, edfilter, essource, service, esproducer, testTask2])
2072 
2073  # test attaching Task to Process
2074  process = Process("test")
2075 
2076  process.mproducer = edproducer
2077  process.mproducer2 = edproducer2
2078  process.mfilter = edfilter
2079  process.messource = essource
2080  process.mesproducer = esproducer
2081  process.d = service
2082 
2083  testTask3 = Task(edproducer, edproducer2)
2084  testTask1.add(testTask3)
2085  process.myTask1 = testTask1
2086 
2087  # test the validation that occurs when attaching a Task to a Process
2088  # first a case that passes, then one the fails on an EDProducer
2089  # then one that fails on a service
2090  l = set()
2091  visitor = NodeNameVisitor(l)
2092  testTask1.visit(visitor)
2093  self.assertTrue(l == set(['mesproducer', 'mproducer', 'mproducer2', 'mfilter', 'd', 'messource']))
2094  l2 = testTask1.moduleNames
2095  self.assertTrue(l == set(['mesproducer', 'mproducer', 'mproducer2', 'mfilter', 'd', 'messource']))
2096 
2097  testTask4 = Task(edproducer3)
2098  l.clear()
2099  self.assertRaises(RuntimeError, testTask4.visit, visitor)
2100  try:
2101  process.myTask4 = testTask4
2102  self.assertTrue(False)
2103  except RuntimeError:
2104  pass
2105 
2106  testTask5 = Task(service3)
2107  l.clear()
2108  self.assertRaises(RuntimeError, testTask5.visit, visitor)
2109  try:
2110  process.myTask5 = testTask5
2111  self.assertTrue(False)
2112  except RuntimeError:
2113  pass
2114 
2115  process.d = service3
2116  process.myTask5 = testTask5
2117 
2118  # test placement into the Process and the tasks property
2119  expectedDict = { 'myTask1' : testTask1, 'myTask5' : testTask5 }
2120  expectedFixedDict = DictTypes.FixedKeysDict(expectedDict);
2121  self.assertTrue(process.tasks == expectedFixedDict)
2122  self.assertTrue(process.tasks['myTask1'] == testTask1)
2123  self.assertTrue(process.myTask1 == testTask1)
2124 
2125  # test replacing an EDProducer in a Task when calling __settattr__
2126  # for the EDProducer on the Process.
2127  process.mproducer2 = edproducer4
2128  process.d = service
2129  l = list()
2130  visitor1 = ModuleNodeVisitor(l)
2131  testTask1.visit(visitor1)
2132  l.sort()
2133  expectedList = sorted([edproducer,essource,esproducer,service,edfilter,edproducer,edproducer4])
2134  self.assertTrue(expectedList == l)
2135 
2136  process.myTask6 = Task()
2137  process.myTask7 = Task()
2138  process.mproducer8 = edproducer8
2139  process.myTask8 = Task(process.mproducer8)
2140  process.myTask6.add(process.myTask7)
2141  process.myTask7.add(process.myTask8)
2142  process.myTask1.add(process.myTask6)
2143  process.myTask8.add(process.myTask5)
2144 
2145  testDict = process._itemsInDependencyOrder(process.tasks)
2146  expectedLabels = ["myTask5", "myTask8", "myTask7", "myTask6", "myTask1"]
2147  expectedTasks = [process.myTask5, process.myTask8, process.myTask7, process.myTask6, process.myTask1]
2148  index = 0
2149  for testLabel, testTask in testDict.items():
2150  self.assertTrue(testLabel == expectedLabels[index])
2151  self.assertTrue(testTask == expectedTasks[index])
2152  index += 1
2153 
2154  pythonDump = testTask1.dumpPython(PrintOptions())
2155 
2156 
2157  expectedPythonDump = 'cms.Task(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer, process.mproducer2, process.myTask6)\n'
2158  self.assertTrue(pythonDump == expectedPythonDump)
2159 
2160  process.myTask5 = Task()
2161  process.myTask100 = Task()
2162  process.mproducer9 = edproducer9
2163  sequence1 = Sequence(process.mproducer8, process.myTask1, process.myTask5, testTask2, testTask3)
2164  sequence2 = Sequence(process.mproducer8 + process.mproducer9)
2165  process.sequence3 = Sequence((process.mproducer8 + process.mfilter))
2166  sequence4 = Sequence()
2167  process.path1 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+sequence4)
2168  process.path1.associate(process.myTask1, process.myTask5, testTask2, testTask3)
2169  process.path11 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+ sequence4,process.myTask1, process.myTask5, testTask2, testTask3, process.myTask100)
2170  process.path2 = Path(process.mproducer)
2171  process.path3 = Path(process.mproducer9+process.mproducer8,testTask2)
2172 
2173  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')
2174 
2175  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')
2176 
2177  # test NodeNameVisitor and moduleNames
2178  l = set()
2179  nameVisitor = NodeNameVisitor(l)
2180  process.path1.visit(nameVisitor)
2181  self.assertTrue(l == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
2182  self.assertTrue(process.path1.moduleNames() == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
2183 
2184  # test copy
2185  process.mproducer10 = EDProducer("b10")
2186  process.path21 = process.path11.copy()
2187  process.path21.replace(process.mproducer, process.mproducer10)
2188 
2189  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')
2190 
2191  # Some peculiarities of the way things work show up here. dumpPython sorts tasks and
2192  # removes duplication at the level of strings. The Task and Sequence objects themselves
2193  # remove duplicate tasks in their contents if the instances are the same (exact same python
2194  # object id which is not the same as the string representation being the same).
2195  # Also note that the mutating visitor replaces sequences and tasks that have
2196  # modified contents with their modified contents, it does not modify the sequence
2197  # or task itself.
2198  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.myTask6), process.myTask100, process.myTask5)\n')
2199 
2200  process.path22 = process.path21.copyAndExclude([process.d, process.mesproducer, process.mfilter])
2201  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.myTask6), process.myTask100, process.myTask5)\n')
2202 
2203  process.path23 = process.path22.copyAndExclude([process.messource, process.mproducer10])
2204  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.myTask6), process.myTask100, process.myTask5)\n')
2205 
2206  process.a = EDAnalyzer("MyAnalyzer")
2207  process.b = OutputModule("MyOutputModule")
2208  process.c = EDFilter("MyFilter")
2209  process.d = EDProducer("MyProducer")
2210  process.e = ESProducer("MyESProducer")
2211  process.f = ESSource("MyESSource")
2212  process.g = ESProducer("g")
2213  process.path24 = Path(process.a+process.b+process.c+process.d)
2214  process.path25 = process.path24.copyAndExclude([process.a,process.b,process.c])
2215  self.assertTrue(process.path25.dumpPython(None) == 'cms.Path(process.d)\n')
2216  #print process.path3
2217  #print process.dumpPython()
2218 
2219  process.path200 = EndPath(Sequence(process.c,Task(process.e)))
2220  process.path200.replace(process.c,process.b)
2221  process.path200.replace(process.e,process.f)
2222  self.assertEqual(process.path200.dumpPython(None), "cms.EndPath(process.b, cms.Task(process.f))\n")
2223  process.path200.replace(process.b,process.c)
2224  process.path200.replace(process.f,process.e)
2225  self.assertEqual(process.path200.dumpPython(None), "cms.EndPath(process.c, cms.Task(process.e))\n")
2226  process.path200.replace(process.c,process.a)
2227  process.path200.replace(process.e,process.g)
2228  self.assertEqual(process.path200.dumpPython(None), "cms.EndPath(process.a, cms.Task(process.g))\n")
2229  process.path200.replace(process.a,process.c)
2230  process.path200.replace(process.g,process.e)
2231  self.assertEqual(process.path200.dumpPython(None), "cms.EndPath(process.c, cms.Task(process.e))\n")
2232 
2233 
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def Config.TestModuleCommand.testTaskPlaceholder (   self)

Definition at line 2739 of file Config.py.

2740  p = Process("test")
2741  p.a = EDProducer("ma")
2742  p.b = EDAnalyzer("mb")
2743  p.t1 = Task(TaskPlaceholder("c"))
2744  p.t2 = Task(p.a, TaskPlaceholder("d"), p.t1)
2745  p.t3 = Task(TaskPlaceholder("e"))
2746  p.path1 = Path(p.b, p.t2, p.t3)
2747  p.t5 = Task(p.a, TaskPlaceholder("g"), TaskPlaceholder("t4"))
2748  p.t4 = Task(TaskPlaceholder("f"))
2749  p.endpath1 = EndPath(p.b, p.t5)
2750  p.t6 = Task(TaskPlaceholder("h"))
2751  p.t7 = Task(p.a, TaskPlaceholder("i"), p.t6)
2752  p.t8 = Task(TaskPlaceholder("j"))
2753  p.schedule = Schedule(p.path1, p.endpath1,tasks=[p.t7,p.t8])
2754  p.c = EDProducer("mc")
2755  p.d = EDProducer("md")
2756  p.e = EDProducer("me")
2757  p.f = EDProducer("mf")
2758  p.g = EDProducer("mg")
2759  p.h = EDProducer("mh")
2760  p.i = EDProducer("mi")
2761  p.j = EDProducer("mj")
2762  self.assertEqual(p.dumpPython(),
2763 """import FWCore.ParameterSet.Config as cms
2764 
2765 process = cms.Process("test")
2766 
2767 process.a = cms.EDProducer("ma")
2768 
2769 
2770 process.c = cms.EDProducer("mc")
2771 
2772 
2773 process.d = cms.EDProducer("md")
2774 
2775 
2776 process.e = cms.EDProducer("me")
2777 
2778 
2779 process.f = cms.EDProducer("mf")
2780 
2781 
2782 process.g = cms.EDProducer("mg")
2783 
2784 
2785 process.h = cms.EDProducer("mh")
2786 
2787 
2788 process.i = cms.EDProducer("mi")
2789 
2790 
2791 process.j = cms.EDProducer("mj")
2792 
2793 
2794 process.b = cms.EDAnalyzer("mb")
2795 
2796 
2797 process.t8 = cms.Task(cms.TaskPlaceholder("j"))
2798 
2799 
2800 process.t6 = cms.Task(cms.TaskPlaceholder("h"))
2801 
2802 
2803 process.t7 = cms.Task(cms.TaskPlaceholder("i"), process.a, process.t6)
2804 
2805 
2806 process.t4 = cms.Task(cms.TaskPlaceholder("f"))
2807 
2808 
2809 process.t5 = cms.Task(cms.TaskPlaceholder("g"), cms.TaskPlaceholder("t4"), process.a)
2810 
2811 
2812 process.t3 = cms.Task(cms.TaskPlaceholder("e"))
2813 
2814 
2815 process.t1 = cms.Task(cms.TaskPlaceholder("c"))
2816 
2817 
2818 process.t2 = cms.Task(cms.TaskPlaceholder("d"), process.a, process.t1)
2819 
2820 
2821 process.path1 = cms.Path(process.b, process.t2, process.t3)
2822 
2823 
2824 process.endpath1 = cms.EndPath(process.b, process.t5)
2825 
2826 
2827 process.schedule = cms.Schedule(*[ process.path1, process.endpath1 ], tasks=[process.t7, process.t8])
2828 """)
2829  p.resolve()
2830  self.assertEqual(p.dumpPython(),
2831 """import FWCore.ParameterSet.Config as cms
2832 
2833 process = cms.Process("test")
2834 
2835 process.a = cms.EDProducer("ma")
2836 
2837 
2838 process.c = cms.EDProducer("mc")
2839 
2840 
2841 process.d = cms.EDProducer("md")
2842 
2843 
2844 process.e = cms.EDProducer("me")
2845 
2846 
2847 process.f = cms.EDProducer("mf")
2848 
2849 
2850 process.g = cms.EDProducer("mg")
2851 
2852 
2853 process.h = cms.EDProducer("mh")
2854 
2855 
2856 process.i = cms.EDProducer("mi")
2857 
2858 
2859 process.j = cms.EDProducer("mj")
2860 
2861 
2862 process.b = cms.EDAnalyzer("mb")
2863 
2864 
2865 process.t8 = cms.Task(process.j)
2866 
2867 
2868 process.t6 = cms.Task(process.h)
2869 
2870 
2871 process.t7 = cms.Task(process.a, process.i, process.t6)
2872 
2873 
2874 process.t4 = cms.Task(process.f)
2875 
2876 
2877 process.t5 = cms.Task(process.a, process.g, process.t4)
2878 
2879 
2880 process.t3 = cms.Task(process.e)
2881 
2882 
2883 process.t1 = cms.Task(process.c)
2884 
2885 
2886 process.t2 = cms.Task(process.a, process.d, process.t1)
2887 
2888 
2889 process.path1 = cms.Path(process.b, process.t2, process.t3)
2890 
2891 
2892 process.endpath1 = cms.EndPath(process.b, process.t5)
2893 
2894 
2895 process.schedule = cms.Schedule(*[ process.path1, process.endpath1 ], tasks=[process.t7, process.t8])
2896 """)
2897 
def testTaskPlaceholder(self)
Definition: Config.py:2739
def Config.TestModuleCommand.testTypedParameterizable (   self)

Definition at line 1590 of file Config.py.

1591  p = _TypedParameterizable("blah", b=int32(1))
1592  #see if copy works deeply
1593  other = p.copy()
1594  other.b = 2
1595  self.assertNotEqual(p.b,other.b)
1596 
def testTypedParameterizable(self)
Definition: Config.py:1590
def Config.TestModuleCommand.testUsing (   self)

Definition at line 2486 of file Config.py.

2486  def testUsing(self):
2487  p = Process('test')
2488  p.block = PSet(a = int32(1))
2489  p.modu = EDAnalyzer('Analyzer', p.block, b = int32(2))
2490  self.assertEqual(p.modu.a.value(),1)
2491  self.assertEqual(p.modu.b.value(),2)
2492 

Member Data Documentation

Config.TestModuleCommand.a

Definition at line 3028 of file Config.py.

Config.TestModuleCommand.proc_mod_

Definition at line 3025 of file Config.py.