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 2275 of file Config.py.

References triggerObjects_cff.id, and harvestTrackValidationPlots.str.

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

Definition at line 2291 of file Config.py.

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

Definition at line 2899 of file Config.py.

References ConfigBuilder.dumpPython().

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

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

Definition at line 2583 of file Config.py.

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

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

Definition at line 2930 of file Config.py.

References cmsPerfStripChart.dict, and resolutioncreator_cfi.object.

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

Definition at line 2494 of file Config.py.

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

References SequenceTypes.ignore(), and harvestTrackValidationPlots.str.

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

Definition at line 2529 of file Config.py.

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

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

Definition at line 2641 of file Config.py.

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

Definition at line 2349 of file Config.py.

References list().

2349  def testSchedule(self):
2350  p = Process("test")
2351  p.a = EDAnalyzer("MyAnalyzer")
2352  p.b = EDAnalyzer("YourAnalyzer")
2353  p.c = EDAnalyzer("OurAnalyzer")
2354  p.d = EDAnalyzer("OurAnalyzer")
2355  p.path1 = Path(p.a)
2356  p.path2 = Path(p.b)
2357  p.path3 = Path(p.d)
2358 
2359  s = Schedule(p.path1,p.path2)
2360  self.assertEqual(s[0],p.path1)
2361  self.assertEqual(s[1],p.path2)
2362  p.schedule = s
2363  self.assert_('b' in p.schedule.moduleNames())
2364  self.assert_(hasattr(p, 'b'))
2365  self.assert_(hasattr(p, 'c'))
2366  self.assert_(hasattr(p, 'd'))
2367  self.assert_(hasattr(p, 'path1'))
2368  self.assert_(hasattr(p, 'path2'))
2369  self.assert_(hasattr(p, 'path3'))
2370  p.prune()
2371  self.assert_('b' in p.schedule.moduleNames())
2372  self.assert_(hasattr(p, 'b'))
2373  self.assert_(not hasattr(p, 'c'))
2374  self.assert_(not hasattr(p, 'd'))
2375  self.assert_(hasattr(p, 'path1'))
2376  self.assert_(hasattr(p, 'path2'))
2377  self.assert_(not hasattr(p, 'path3'))
2378 
2379  self.assertTrue(len(p.schedule._tasks) == 0)
2380 
2381  p = Process("test")
2382  p.a = EDAnalyzer("MyAnalyzer")
2383  p.b = EDAnalyzer("YourAnalyzer")
2384  p.c = EDAnalyzer("OurAnalyzer")
2385  p.d = EDAnalyzer("dAnalyzer")
2386  p.e = EDProducer("eProducer")
2387  p.f = EDProducer("fProducer")
2388  p.Tracer = Service("Tracer")
2389  p.path1 = Path(p.a)
2390  p.path2 = Path(p.b)
2391  p.path3 = Path(p.d)
2392  p.task1 = Task(p.e)
2393  p.task2 = Task(p.f, p.Tracer)
2394  s = Schedule(p.path1,p.path2,tasks=[p.task1,p.task2,p.task1])
2395  self.assertEqual(s[0],p.path1)
2396  self.assertEqual(s[1],p.path2)
2397  self.assertTrue(len(s._tasks) == 2)
2398  self.assertTrue(p.task1 in s._tasks)
2399  self.assertTrue(p.task2 in s._tasks)
2400  listOfTasks = list(s._tasks)
2401  self.assertTrue(len(listOfTasks) == 2)
2402  self.assertTrue(p.task1 == listOfTasks[0])
2403  self.assertTrue(p.task2 == listOfTasks[1])
2404  p.schedule = s
2405  self.assert_('b' in p.schedule.moduleNames())
2406 
2407  process2 = Process("test")
2408  process2.a = EDAnalyzer("MyAnalyzer")
2409  process2.e = EDProducer("eProducer")
2410  process2.path1 = Path(process2.a)
2411  process2.task1 = Task(process2.e)
2412  process2.schedule = Schedule(process2.path1,tasks=process2.task1)
2413  listOfTasks = list(process2.schedule._tasks)
2414  self.assertTrue(listOfTasks[0] == process2.task1)
2415 
2416  # test Schedule copy
2417  s2 = s.copy()
2418  self.assertEqual(s2[0],p.path1)
2419  self.assertEqual(s2[1],p.path2)
2420  self.assertTrue(len(s2._tasks) == 2)
2421  self.assertTrue(p.task1 in s2._tasks)
2422  self.assertTrue(p.task2 in s2._tasks)
2423  listOfTasks = list(s2._tasks)
2424  self.assertTrue(len(listOfTasks) == 2)
2425  self.assertTrue(p.task1 == listOfTasks[0])
2426  self.assertTrue(p.task2 == listOfTasks[1])
2427 
2428  names = s.moduleNames()
2429  self.assertTrue(names == set(['a', 'b', 'e', 'Tracer', 'f']))
2430  #adding a path not attached to the Process should cause an exception
2431  p = Process("test")
2432  p.a = EDAnalyzer("MyAnalyzer")
2433  path1 = Path(p.a)
2434  s = Schedule(path1)
2435  self.assertRaises(RuntimeError, lambda : p.setSchedule_(s) )
2436 
2437  #make sure anonymous sequences work
2438  p = Process("test")
2439  p.a = EDAnalyzer("MyAnalyzer")
2440  p.b = EDAnalyzer("MyOtherAnalyzer")
2441  p.c = EDProducer("MyProd")
2442  path1 = Path(p.c*Sequence(p.a+p.b))
2443  s = Schedule(path1)
2444  self.assert_('a' in s.moduleNames())
2445  self.assert_('b' in s.moduleNames())
2446  self.assert_('c' in s.moduleNames())
2447  p.path1 = path1
2448  p.schedule = s
2449  p.prune()
2450  self.assert_('a' in s.moduleNames())
2451  self.assert_('b' in s.moduleNames())
2452  self.assert_('c' in s.moduleNames())
2453 
def testSchedule(self)
Definition: Config.py:2349
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 harvestTrackValidationPlots.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
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 2601 of file Config.py.

References cond.hash, and harvestTrackValidationPlots.str.

2601  def testSubProcess(self):
2602  process = Process("Parent")
2603  subProcess = Process("Child")
2604  subProcess.a = EDProducer("A")
2605  subProcess.p = Path(subProcess.a)
2606  subProcess.add_(Service("Foo"))
2607  process.addSubProcess(SubProcess(subProcess))
2608  d = process.dumpPython()
2609  equalD ="""import FWCore.ParameterSet.Config as cms
2610 
2611 process = cms.Process("Parent")
2612 
2613 parentProcess = process
2614 import FWCore.ParameterSet.Config as cms
2615 
2616 process = cms.Process("Child")
2617 
2618 process.a = cms.EDProducer("A")
2619 
2620 
2621 process.Foo = cms.Service("Foo")
2622 
2623 
2624 process.p = cms.Path(process.a)
2625 
2626 
2627 childProcess = process
2628 process = parentProcess
2629 process.addSubProcess(cms.SubProcess(process = childProcess, SelectEvents = cms.untracked.PSet(
2630 
2631 ), outputCommands = cms.untracked.vstring()))
2632 
2633 """
2634  equalD = equalD.replace("parentProcess","parentProcess"+str(hash(process.subProcesses_()[0])))
2635  self.assertEqual(d,equalD)
2636  p = TestMakePSet()
2637  process.fillProcessDesc(p)
2638  self.assertEqual((True,['a']),p.values["subProcesses"][1][0].values["process"][1].values['@all_modules'])
2639  self.assertEqual((True,['p']),p.values["subProcesses"][1][0].values["process"][1].values['@paths'])
2640  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:2601
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 = [edproducer,essource,esproducer,service,edfilter,edproducer,edproducer4]
2134  expectedList.sort()
2135  self.assertTrue(expectedList == l)
2136 
2137  process.myTask6 = Task()
2138  process.myTask7 = Task()
2139  process.mproducer8 = edproducer8
2140  process.myTask8 = Task(process.mproducer8)
2141  process.myTask6.add(process.myTask7)
2142  process.myTask7.add(process.myTask8)
2143  process.myTask1.add(process.myTask6)
2144  process.myTask8.add(process.myTask5)
2145 
2146  testDict = process._itemsInDependencyOrder(process.tasks)
2147  expectedLabels = ["myTask5", "myTask8", "myTask7", "myTask6", "myTask1"]
2148  expectedTasks = [process.myTask5, process.myTask8, process.myTask7, process.myTask6, process.myTask1]
2149  index = 0
2150  for testLabel, testTask in testDict.items():
2151  self.assertTrue(testLabel == expectedLabels[index])
2152  self.assertTrue(testTask == expectedTasks[index])
2153  index += 1
2154 
2155  pythonDump = testTask1.dumpPython(PrintOptions())
2156 
2157 
2158  expectedPythonDump = 'cms.Task(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer, process.mproducer2, process.myTask6)\n'
2159  self.assertTrue(pythonDump == expectedPythonDump)
2160 
2161  process.myTask5 = Task()
2162  process.myTask100 = Task()
2163  process.mproducer9 = edproducer9
2164  sequence1 = Sequence(process.mproducer8, process.myTask1, process.myTask5, testTask2, testTask3)
2165  sequence2 = Sequence(process.mproducer8 + process.mproducer9)
2166  process.sequence3 = Sequence((process.mproducer8 + process.mfilter))
2167  sequence4 = Sequence()
2168  process.path1 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+sequence4)
2169  process.path1.associate(process.myTask1, process.myTask5, testTask2, testTask3)
2170  process.path11 = Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+ sequence4,process.myTask1, process.myTask5, testTask2, testTask3, process.myTask100)
2171  process.path2 = Path(process.mproducer)
2172  process.path3 = Path(process.mproducer9+process.mproducer8,testTask2)
2173 
2174  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')
2175 
2176  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')
2177 
2178  # test NodeNameVisitor and moduleNames
2179  l = set()
2180  nameVisitor = NodeNameVisitor(l)
2181  process.path1.visit(nameVisitor)
2182  self.assertTrue(l == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
2183  self.assertTrue(process.path1.moduleNames() == set(['mproducer', 'd', 'mesproducer', None, 'mproducer9', 'mproducer8', 'messource', 'mproducer2', 'mfilter']))
2184 
2185  # test copy
2186  process.mproducer10 = EDProducer("b10")
2187  process.path21 = process.path11.copy()
2188  process.path21.replace(process.mproducer, process.mproducer10)
2189 
2190  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')
2191 
2192  # Some peculiarities of the way things work show up here. dumpPython sorts tasks and
2193  # removes duplication at the level of strings. The Task and Sequence objects themselves
2194  # remove duplicate tasks in their contents if the instances are the same (exact same python
2195  # object id which is not the same as the string representation being the same).
2196  # Also note that the mutating visitor replaces sequences and tasks that have
2197  # modified contents with their modified contents, it does not modify the sequence
2198  # or task itself.
2199  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')
2200 
2201  process.path22 = process.path21.copyAndExclude([process.d, process.mesproducer, process.mfilter])
2202  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')
2203 
2204  process.path23 = process.path22.copyAndExclude([process.messource, process.mproducer10])
2205  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')
2206 
2207  process.a = EDAnalyzer("MyAnalyzer")
2208  process.b = OutputModule("MyOutputModule")
2209  process.c = EDFilter("MyFilter")
2210  process.d = EDProducer("MyProducer")
2211  process.e = ESProducer("MyESProducer")
2212  process.f = ESSource("MyESSource")
2213  process.g = ESProducer("g")
2214  process.path24 = Path(process.a+process.b+process.c+process.d)
2215  process.path25 = process.path24.copyAndExclude([process.a,process.b,process.c])
2216  self.assertTrue(process.path25.dumpPython(None) == 'cms.Path(process.d)\n')
2217  #print process.path3
2218  #print process.dumpPython()
2219 
2220  process.path200 = EndPath(Sequence(process.c,Task(process.e)))
2221  process.path200.replace(process.c,process.b)
2222  process.path200.replace(process.e,process.f)
2223  self.assertEqual(process.path200.dumpPython(None), "cms.EndPath(process.b, cms.Task(process.f))\n")
2224  process.path200.replace(process.b,process.c)
2225  process.path200.replace(process.f,process.e)
2226  self.assertEqual(process.path200.dumpPython(None), "cms.EndPath(process.c, cms.Task(process.e))\n")
2227  process.path200.replace(process.c,process.a)
2228  process.path200.replace(process.e,process.g)
2229  self.assertEqual(process.path200.dumpPython(None), "cms.EndPath(process.a, cms.Task(process.g))\n")
2230  process.path200.replace(process.a,process.c)
2231  process.path200.replace(process.g,process.e)
2232  self.assertEqual(process.path200.dumpPython(None), "cms.EndPath(process.c, cms.Task(process.e))\n")
2233 
2234 
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 2740 of file Config.py.

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

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

Member Data Documentation

Config.TestModuleCommand.a

Definition at line 3029 of file Config.py.

Config.TestModuleCommand.proc_mod_

Definition at line 3026 of file Config.py.