CMS 3D CMS Logo

Public Member Functions | Static Public Attributes

Config::TestModuleCommand Class Reference

List of all members.

Public Member Functions

def setUp
def testCloneSequence
def testExamples
def testFreeze
def testGlobalReplace
def testImplicitSchedule
def testOverride
def testParameterizable
def testPath
def testPrefers
def testProcessDumpPython
def testProcessExtend
def testProcessInsertion
def testPrune
def testSchedule
def testSecSource
def testSequence
def testSequence2
def testSubProcess
def testTypedParameterizable
def testUsing

Static Public Attributes

tuple d = p.dumpPython()
tuple p = Process("test")
tuple s = Sequence(p.a)

Detailed Description

Definition at line 1076 of file Config.py.


Member Function Documentation

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

Definition at line 1077 of file Config.py.

01078                        :
01079             """Nothing to do """
            None
def Config::TestModuleCommand::testCloneSequence (   self)

Definition at line 1372 of file Config.py.

01373                                    :
01374             p = Process("test")
01375             a = EDAnalyzer("MyAnalyzer")
01376             p.a = a
01377             a.setLabel("a")
01378             b = EDAnalyzer("YOurAnalyzer")
01379             p.b = b
01380             b.setLabel("b")
01381             path = Path(a * b)
01382             p.path = Path(p.a*p.b)
01383             lookuptable = {id(a): p.a, id(b): p.b}
01384             #self.assertEqual(str(path),str(path._postProcessFixup(lookuptable)))
01385             #lookuptable = p._cloneToObjectDict
01386             #self.assertEqual(str(path),str(path._postProcessFixup(lookuptable)))
01387             self.assertEqual(str(path),str(p.path))

def Config::TestModuleCommand::testExamples (   self)

Definition at line 1505 of file Config.py.

01506                               :
01507             p = Process("Test")
01508             p.source = Source("PoolSource",fileNames = untracked(string("file:reco.root")))
01509             p.foos = EDProducer("FooProducer")
01510             p.bars = EDProducer("BarProducer", foos=InputTag("foos"))
01511             p.out = OutputModule("PoolOutputModule",fileName=untracked(string("file:foos.root")))
01512             p.bars.foos = 'Foosball'
01513             self.assertEqual(p.bars.foos, InputTag('Foosball'))
01514             p.p = Path(p.foos*p.bars)
01515             p.e = EndPath(p.out)
01516             p.add_(Service("MessageLogger"))

def Config::TestModuleCommand::testFreeze (   self)

Definition at line 1571 of file Config.py.

01572                             :
01573             process = Process("Freeze")
01574             m = EDProducer("M", p=PSet(i = int32(1)))
01575             m.p.i = 2
01576             process.m = m
01577             # should be frozen
01578             #self.assertRaises(ValueError, setattr, m.p, 'i', 3)
01579             #self.assertRaises(ValueError, setattr, m, 'p', PSet(i=int32(1)))
01580             #self.assertRaises(ValueError, setattr, m.p, 'j', 1)
01581             #self.assertRaises(ValueError, setattr, m, 'j', 1)
01582             # But OK to change through the process
01583             process.m.p.i = 4
01584             self.assertEqual(process.m.p.i.value(), 4)
01585             process.m.p = PSet(j=int32(1))
01586             # should work to clone it, though
01587             m2 = m.clone(p = PSet(i = int32(5)), j = int32(8))
01588             m2.p.i = 6
            m2.j = 8
def Config::TestModuleCommand::testGlobalReplace (   self)

Definition at line 1315 of file Config.py.

01316                                    :
01317             p = Process('test')
01318             p.a = EDAnalyzer("MyAnalyzer")
01319             p.b = EDAnalyzer("YourAnalyzer")
01320             p.c = EDAnalyzer("OurAnalyzer")
01321             p.s = Sequence(p.a*p.b)
01322             p.p = Path(p.c+p.s+p.a)
01323             new = EDAnalyzer("NewAnalyzer")
01324             p.globalReplace("a",new)

def Config::TestModuleCommand::testImplicitSchedule (   self)

Definition at line 1442 of file Config.py.

01443                                       :
01444             p = Process("test")
01445             p.a = EDAnalyzer("MyAnalyzer")
01446             p.b = EDAnalyzer("YourAnalyzer")
01447             p.c = EDAnalyzer("OurAnalyzer")
01448             p.path1 = Path(p.a)
01449             p.path2 = Path(p.b)
01450             self.assert_(p.schedule is None)
01451             pths = p.paths
01452             keys = pths.keys()
01453             self.assertEqual(pths[keys[0]],p.path1)
01454             self.assertEqual(pths[keys[1]],p.path2)
01455             p.prune()
01456             self.assert_(hasattr(p, 'a'))
01457             self.assert_(hasattr(p, 'b'))
01458             self.assert_(not hasattr(p, 'c'))
01459             self.assert_(hasattr(p, 'path1'))
01460             self.assert_(hasattr(p, 'path2'))
01461 
01462 
01463             p = Process("test")
01464             p.a = EDAnalyzer("MyAnalyzer")
01465             p.b = EDAnalyzer("YourAnalyzer")
01466             p.c = EDAnalyzer("OurAnalyzer")
01467             p.path2 = Path(p.b)
01468             p.path1 = Path(p.a)
01469             self.assert_(p.schedule is None)
01470             pths = p.paths
01471             keys = pths.keys()
01472             self.assertEqual(pths[keys[1]],p.path1)
01473             self.assertEqual(pths[keys[0]],p.path2)
01474 

def Config::TestModuleCommand::testOverride (   self)

Definition at line 1482 of file Config.py.

01483                               :
01484             p = Process('test')
01485             a = EDProducer("A", a1=int32(0))
01486             self.assert_(not a.isModified())
01487             a.a1 = 1
01488             self.assert_(a.isModified())
01489             p.a = a
01490             self.assertEqual(p.a.a1.value(), 1)
01491             # try adding an unmodified module.
01492             # should accept it
01493             p.a = EDProducer("A", a1=int32(2))
01494             self.assertEqual(p.a.a1.value(), 2)
01495             # try adding a modified module.  Should throw
01496             # no longer, since the same (modified) say, geometry
01497             # could come from more than one cff
01498             b = EDProducer("A", a1=int32(3))
01499             b.a1 = 4
01500             #self.assertRaises(RuntimeError, setattr, *(p,'a',b))
01501             ps1 = PSet(a = int32(1))
01502             ps2 = PSet(a = int32(2))
01503             self.assertRaises(ValueError, EDProducer, 'C', ps1, ps2)
01504             self.assertRaises(ValueError, EDProducer, 'C', ps1, a=int32(3))

def Config::TestModuleCommand::testParameterizable (   self)

Definition at line 1080 of file Config.py.

01081                                      :
01082             p = _Parameterizable()
01083             self.assertEqual(len(p.parameterNames_()),0)
01084             p.a = int32(1)
01085             self.assert_('a' in p.parameterNames_())
01086             self.assertEqual(p.a.value(), 1)
01087             p.a = 10
01088             self.assertEqual(p.a.value(), 10)
01089             p.a = untracked(int32(1))
01090             self.assertEqual(p.a.value(), 1)
01091             self.failIf(p.a.isTracked())
01092             p.a = untracked.int32(1)
01093             self.assertEqual(p.a.value(), 1)
01094             self.failIf(p.a.isTracked())
01095             p = _Parameterizable(foo=int32(10), bar = untracked(double(1.0)))
01096             self.assertEqual(p.foo.value(), 10)
01097             self.assertEqual(p.bar.value(),1.0)
01098             self.failIf(p.bar.isTracked())
01099             self.assertRaises(TypeError,setattr,(p,'c',1))
01100             p = _Parameterizable(a=PSet(foo=int32(10), bar = untracked(double(1.0))))
01101             self.assertEqual(p.a.foo.value(),10)
01102             self.assertEqual(p.a.bar.value(),1.0)
01103             p.b = untracked(PSet(fii = int32(1)))
01104             self.assertEqual(p.b.fii.value(),1)
01105             self.failIf(p.b.isTracked())
01106             #test the fact that values can be shared
01107             v = int32(10)
01108             p=_Parameterizable(a=v)
01109             v.setValue(11)
01110             self.assertEqual(p.a.value(),11)
01111             p.a = 12
01112             self.assertEqual(p.a.value(),12)
            self.assertEqual(v.value(),12)
def Config::TestModuleCommand::testPath (   self)

Definition at line 1350 of file Config.py.

01351                           :
01352             p = Process("test")
01353             p.a = EDAnalyzer("MyAnalyzer")
01354             p.b = EDAnalyzer("YourAnalyzer")
01355             p.c = EDAnalyzer("OurAnalyzer")
01356             path = Path(p.a)
01357             path *= p.b
01358             path += p.c
01359             self.assertEqual(str(path),'a+b+c')
01360             path = Path(p.a*p.b+p.c)
01361             self.assertEqual(str(path),'a+b+c')
01362 #            path = Path(p.a)*p.b+p.c #This leads to problems with sequences
01363 #            self.assertEqual(str(path),'((a*b)+c)')
01364             path = Path(p.a+ p.b*p.c)
01365             self.assertEqual(str(path),'a+b+c')
01366             path = Path(p.a*(p.b+p.c))
01367             self.assertEqual(str(path),'a+b+c')
01368             path = Path(p.a*(p.b+~p.c))
01369             self.assertEqual(str(path),'a+b+~c')
01370             p.es = ESProducer("AnESProducer")
01371             self.assertRaises(TypeError,Path,p.es)

def Config::TestModuleCommand::testPrefers (   self)

Definition at line 1517 of file Config.py.

01518                              :
01519             p = Process("Test")
01520             p.add_(ESSource("ForceSource"))
01521             p.juicer = ESProducer("JuicerProducer")
01522             p.prefer("ForceSource")
01523             p.prefer("juicer")
01524             self.assertEqual(p.dumpConfig(),
01525 """process Test = {
01526     es_module juicer = JuicerProducer { 
01527     }
01528     es_source  = ForceSource { 
01529     }
01530     es_prefer  = ForceSource { 
01531     }
01532     es_prefer juicer = JuicerProducer { 
01533     }
01534 }
01535 """)
01536             p.prefer("juicer",fooRcd=vstring("Foo"))
01537             self.assertEqual(p.dumpConfig(),
01538 """process Test = {
01539     es_module juicer = JuicerProducer { 
01540     }
01541     es_source  = ForceSource { 
01542     }
01543     es_prefer  = ForceSource { 
01544     }
01545     es_prefer juicer = JuicerProducer { 
01546         vstring fooRcd = {
01547             'Foo'
01548         }
01549 
01550     }
01551 }
01552 """)
01553             self.assertEqual(p.dumpPython(),
01554 """import FWCore.ParameterSet.Config as cms
01555 
01556 process = cms.Process("Test")
01557 
01558 process.juicer = cms.ESProducer("JuicerProducer")
01559 
01560 
01561 process.ForceSource = cms.ESSource("ForceSource")
01562 
01563 
01564 process.prefer("ForceSource")
01565 
01566 process.prefer("juicer",
01567     fooRcd = cms.vstring('Foo')
01568 )
01569 
01570 """)

def Config::TestModuleCommand::testProcessDumpPython (   self)

Definition at line 1215 of file Config.py.

01216                                        :
01217             p = Process("test")
01218             p.a = EDAnalyzer("MyAnalyzer")
01219             p.p = Path(p.a)
01220             p.s = Sequence(p.a)
01221             p.r = Sequence(p.s)
01222             p.p2 = Path(p.s)
01223             p.schedule = Schedule(p.p2,p.p)
01224             d=p.dumpPython()
01225             self.assertEqual(d,
01226 """import FWCore.ParameterSet.Config as cms
01227 
01228 process = cms.Process("test")
01229 
01230 process.a = cms.EDAnalyzer("MyAnalyzer")
01231 
01232 
01233 process.s = cms.Sequence(process.a)
01234 
01235 
01236 process.r = cms.Sequence(process.s)
01237 
01238 
01239 process.p = cms.Path(process.a)
01240 
01241 
01242 process.p2 = cms.Path(process.s)
01243 
01244 
01245 process.schedule = cms.Schedule(*[ process.p2, process.p ])
01246 """)
01247             #Reverse order of 'r' and 's'
01248             p = Process("test")
01249             p.a = EDAnalyzer("MyAnalyzer")
01250             p.p = Path(p.a)
01251             p.r = Sequence(p.a)
01252             p.s = Sequence(p.r)
01253             p.p2 = Path(p.r)
01254             p.schedule = Schedule(p.p2,p.p)
01255             p.b = EDAnalyzer("YourAnalyzer")
01256             d=p.dumpPython()
01257             self.assertEqual(d,
01258 """import FWCore.ParameterSet.Config as cms
01259 
01260 process = cms.Process("test")
01261 
01262 process.a = cms.EDAnalyzer("MyAnalyzer")
01263 
01264 
01265 process.b = cms.EDAnalyzer("YourAnalyzer")
01266 
01267 
01268 process.r = cms.Sequence(process.a)
01269 
01270 
01271 process.s = cms.Sequence(process.r)
01272 
01273 
01274 process.p = cms.Path(process.a)
01275 
01276 
01277 process.p2 = cms.Path(process.r)
01278 
01279 
01280 process.schedule = cms.Schedule(*[ process.p2, process.p ])
""")
def Config::TestModuleCommand::testProcessExtend (   self)

Definition at line 1145 of file Config.py.

01146                                    :
01147             class FromArg(object):
01148                 def __init__(self,*arg,**args):
01149                     for name in args.iterkeys():
01150                         self.__dict__[name]=args[name]
01151 
01152             a=EDAnalyzer("MyAnalyzer")
01153             t=EDAnalyzer("MyAnalyzer")
01154             t.setLabel("foo")
01155             s1 = Sequence(a)
01156             s2 = Sequence(s1)
01157             s3 = Sequence(s2)
01158             d = FromArg(
01159                     a=a,
01160                     b=Service("Full"),
01161                     c=Path(a),
01162                     d=s2,
01163                     e=s1,
01164                     f=s3,
01165                     g=Sequence(s1+s2+s3)
01166                 )
01167             p = Process("Test")
01168             p.extend(d)
01169             self.assertEqual(p.a.type_(),"MyAnalyzer")
01170             self.assertEqual(p.a.label_(),"a")
01171             self.assertRaises(AttributeError,getattr,p,'b')
01172             self.assertEqual(p.Full.type_(),"Full")
01173             self.assertEqual(str(p.c),'a')
01174             self.assertEqual(str(p.d),'a')
01175 
01176             z1 = FromArg(
01177                     a=a,
01178                     b=Service("Full"),
01179                     c=Path(a),
01180                     d=s2,
01181                     e=s1,
01182                     f=s3,
01183                     s4=s3,
01184                     g=Sequence(s1+s2+s3)
01185                  )
01186             
01187             p1 = Process("Test")
01188             #p1.extend(z1)
01189             self.assertRaises(ValueError, p1.extend, z1)
01190 
01191             z2 = FromArg(
01192                     a=a,
01193                     b=Service("Full"),
01194                     c=Path(a),
01195                     d=s2,
01196                     e=s1,
01197                     f=s3,
01198                     aaa=copy.deepcopy(a),
01199                     s4=copy.deepcopy(s3),
01200                     g=Sequence(s1+s2+s3),
01201                     t=t
01202                 )
01203             p2 = Process("Test")
01204             p2.extend(z2)
01205             #self.assertRaises(ValueError, p2.extend, z2)
01206             self.assertEqual(p2.s4.label_(),"s4")
01207             #p2.s4.setLabel("foo")
01208             self.assertRaises(ValueError, p2.s4.setLabel, "foo")
01209             p2.s4.setLabel("s4")
01210             p2.s4.setLabel(None)
01211             p2.s4.setLabel("foo")
01212             p2._Process__setObjectLabel(p2.s4, "foo")
01213             p2._Process__setObjectLabel(p2.s4, None)
01214             p2._Process__setObjectLabel(p2.s4, "bar")

def Config::TestModuleCommand::testProcessInsertion (   self)

Definition at line 1120 of file Config.py.

01121                                       :
01122             p = Process("test")
01123             p.a = EDAnalyzer("MyAnalyzer")
01124             self.assert_( 'a' in p.analyzers_() )
01125             self.assert_( 'a' in p.analyzers)
01126             p.add_(Service("MessageLogger"))
01127             self.assert_('MessageLogger' in p.services_())
01128             self.assertEqual(p.MessageLogger.type_(), "MessageLogger")
01129             p.Tracer = Service("Tracer")
01130             self.assert_('Tracer' in p.services_())
01131             self.assertRaises(TypeError, setattr, *(p,'b',"this should fail"))
01132             self.assertRaises(TypeError, setattr, *(p,'bad',Service("MessageLogger")))
01133             self.assertRaises(ValueError, setattr, *(p,'bad',Source("PoolSource")))
01134             p.out = OutputModule("Outer")
01135             self.assertEqual(p.out.type_(), 'Outer')
01136             self.assert_( 'out' in p.outputModules_() )
01137 
01138             p.geom = ESSource("GeomProd")
01139             self.assert_('geom' in p.es_sources_())
01140             p.add_(ESSource("ConfigDB"))
01141             self.assert_('ConfigDB' in p.es_sources_())
01142 
01143             p.aliasfoo1 = EDAlias(foo1 = VPSet(PSet(type = string("Foo1"))))
01144             self.assert_('aliasfoo1' in p.aliases_())

def Config::TestModuleCommand::testPrune (   self)

Definition at line 1628 of file Config.py.

01629                            :
01630             p = Process("test")
01631             p.a = EDAnalyzer("MyAnalyzer")
01632             p.b = EDAnalyzer("YourAnalyzer")
01633             p.c = EDAnalyzer("OurAnalyzer")
01634             p.d = EDAnalyzer("OurAnalyzer")
01635             p.s = Sequence(p.d)
01636             p.path1 = Path(p.a)
01637             p.path2 = Path(p.b)
01638             self.assert_(p.schedule is None)
01639             pths = p.paths
01640             keys = pths.keys()
01641             self.assertEqual(pths[keys[0]],p.path1)
01642             self.assertEqual(pths[keys[1]],p.path2)
01643             p.pset1 = PSet(parA = string("pset1"))
01644             p.pset2 = untracked.PSet(parA = string("pset2"))
01645             p.vpset1 = VPSet()
01646             p.vpset2 = untracked.VPSet()
01647             p.prune()
01648             self.assert_(hasattr(p, 'a'))
01649             self.assert_(hasattr(p, 'b'))
01650             self.assert_(not hasattr(p, 'c'))
01651             self.assert_(not hasattr(p, 'd'))
01652             self.assert_(not hasattr(p, 's'))
01653             self.assert_(hasattr(p, 'path1'))
01654             self.assert_(hasattr(p, 'path2'))
01655             self.assert_(not hasattr(p, 'pset1'))
01656             self.assert_(hasattr(p, 'pset2'))
01657             self.assert_(not hasattr(p, 'vpset1'))
01658             self.assert_(not hasattr(p, 'vpset2'))
01659 
01660             p = Process("test")
01661             p.a = EDAnalyzer("MyAnalyzer")
01662             p.b = EDAnalyzer("YourAnalyzer")
01663             p.c = EDAnalyzer("OurAnalyzer")
01664             p.d = EDAnalyzer("OurAnalyzer")
01665             p.e = EDAnalyzer("OurAnalyzer")
01666             p.s = Sequence(p.d)
01667             p.s2 = Sequence(p.b)
01668             p.s3 = Sequence(p.e)
01669             p.path1 = Path(p.a)
01670             p.path2 = Path(p.b)
01671             p.path3 = Path(p.b+p.s2)
01672             p.path4 = Path(p.b+p.s3)
01673             p.schedule = Schedule(p.path1,p.path2,p.path3)
01674             pths = p.paths
01675             keys = pths.keys()
01676             self.assertEqual(pths[keys[0]],p.path1)
01677             self.assertEqual(pths[keys[1]],p.path2)
01678             p.prune()
01679             self.assert_(hasattr(p, 'a'))
01680             self.assert_(hasattr(p, 'b'))
01681             self.assert_(not hasattr(p, 'c'))
01682             self.assert_(not hasattr(p, 'd'))
01683             self.assert_(not hasattr(p, 'e'))
01684             self.assert_(not hasattr(p, 's'))
01685             self.assert_(hasattr(p, 's2'))
01686             self.assert_(not hasattr(p, 's3'))
01687             self.assert_(hasattr(p, 'path1'))
01688             self.assert_(hasattr(p, 'path2'))
01689             self.assert_(hasattr(p, 'path3'))
01690             self.assert_(not hasattr(p, 'path4'))
01691             #test SequencePlaceholder
01692             p = Process("test")
01693             p.a = EDAnalyzer("MyAnalyzer")
01694             p.b = EDAnalyzer("YourAnalyzer")
01695             p.s = Sequence(SequencePlaceholder("a")+p.b)
01696             p.pth = Path(p.s)
01697             p.prune()
01698             self.assert_(hasattr(p, 'a'))
01699             self.assert_(hasattr(p, 'b'))
01700             self.assert_(hasattr(p, 's'))
01701             self.assert_(hasattr(p, 'pth'))
01702 
    unittest.main()
def Config::TestModuleCommand::testSchedule (   self)

Definition at line 1388 of file Config.py.

01389                               :
01390             p = Process("test")
01391             p.a = EDAnalyzer("MyAnalyzer")
01392             p.b = EDAnalyzer("YourAnalyzer")
01393             p.c = EDAnalyzer("OurAnalyzer")
01394             p.d = EDAnalyzer("OurAnalyzer")
01395             p.path1 = Path(p.a)
01396             p.path2 = Path(p.b)
01397             p.path3 = Path(p.d)
01398 
01399             s = Schedule(p.path1,p.path2)
01400             self.assertEqual(s[0],p.path1)
01401             self.assertEqual(s[1],p.path2)
01402             p.schedule = s
01403             self.assert_('b' in p.schedule.moduleNames())
01404             self.assert_(hasattr(p, 'b'))
01405             self.assert_(hasattr(p, 'c'))
01406             self.assert_(hasattr(p, 'd'))
01407             self.assert_(hasattr(p, 'path1'))
01408             self.assert_(hasattr(p, 'path2'))
01409             self.assert_(hasattr(p, 'path3'))
01410             p.prune()
01411             self.assert_('b' in p.schedule.moduleNames())
01412             self.assert_(hasattr(p, 'b'))
01413             self.assert_(not hasattr(p, 'c'))
01414             self.assert_(not hasattr(p, 'd'))
01415             self.assert_(hasattr(p, 'path1'))
01416             self.assert_(hasattr(p, 'path2'))
01417             self.assert_(not hasattr(p, 'path3'))
01418 
01419             #adding a path not attached to the Process should cause an exception
01420             p = Process("test")
01421             p.a = EDAnalyzer("MyAnalyzer")
01422             path1 = Path(p.a)
01423             s = Schedule(path1)
01424             self.assertRaises(RuntimeError, lambda : p.setSchedule_(s) )
01425 
01426             #make sure anonymous sequences work
01427             p = Process("test")
01428             p.a = EDAnalyzer("MyAnalyzer")
01429             p.b = EDAnalyzer("MyOtherAnalyzer")
01430             p.c = EDProducer("MyProd")
01431             path1 = Path(p.c*Sequence(p.a+p.b))
01432             s = Schedule(path1)
01433             self.assert_('a' in s.moduleNames())
01434             self.assert_('b' in s.moduleNames())
01435             self.assert_('c' in s.moduleNames())
01436             p.path1 = path1
01437             p.schedule = s
01438             p.prune()
01439             self.assert_('a' in s.moduleNames())
01440             self.assert_('b' in s.moduleNames())
01441             self.assert_('c' in s.moduleNames())

def Config::TestModuleCommand::testSecSource (   self)

Definition at line 1310 of file Config.py.

01311                                :
01312             p = Process('test')
01313             p.a = SecSource("MySecSource")
01314             self.assertEqual(p.dumpPython().replace('\n',''),'import FWCore.ParameterSet.Config as cmsprocess = cms.Process("test")process.a = cms.SecSource("MySecSource")')

def Config::TestModuleCommand::testSequence (   self)

Definition at line 1325 of file Config.py.

01326                               :
01327             p = Process('test')
01328             p.a = EDAnalyzer("MyAnalyzer")
01329             p.b = EDAnalyzer("YourAnalyzer")
01330             p.c = EDAnalyzer("OurAnalyzer")
01331             p.s = Sequence(p.a*p.b)
01332             self.assertEqual(str(p.s),'a+b')
01333             self.assertEqual(p.s.label_(),'s')
01334             path = Path(p.c+p.s)
01335             self.assertEqual(str(path),'c+a+b')
01336             p._validateSequence(path, 'p1')
01337             notInProcess = EDAnalyzer('NotInProcess')
01338             p2 = Path(p.c+p.s*notInProcess)
01339             self.assertRaises(RuntimeError, p._validateSequence, p2, 'p2')

def Config::TestModuleCommand::testSequence2 (   self)

Definition at line 1340 of file Config.py.

01341                                :
01342             p = Process('test')
01343             p.a = EDAnalyzer("MyAnalyzer")
01344             p.b = EDAnalyzer("YourAnalyzer")
01345             p.c = EDAnalyzer("OurAnalyzer")
01346             testseq = Sequence(p.a*p.b)
01347             p.s = testseq
01348             #p.y = testseq
01349             self.assertRaises(ValueError, p.__setattr__, "y", testseq) 

def Config::TestModuleCommand::testSubProcess (   self)

Definition at line 1589 of file Config.py.

01590                                 :
01591             process = Process("Parent")
01592             subProcess = Process("Child")
01593             subProcess.a = EDProducer("A")
01594             subProcess.p = Path(subProcess.a)
01595             subProcess.add_(Service("Foo"))
01596             process.add_( SubProcess(subProcess) )
01597             d = process.dumpPython()
01598             equalD ="""import FWCore.ParameterSet.Config as cms
01599 
01600 process = cms.Process("Parent")
01601 
01602 parentProcess = process
01603 import FWCore.ParameterSet.Config as cms
01604 
01605 process = cms.Process("Child")
01606 
01607 process.a = cms.EDProducer("A")
01608 
01609 
01610 process.p = cms.Path(process.a)
01611 
01612 
01613 process.Foo = cms.Service("Foo")
01614 
01615 
01616 childProcess = process
01617 process = parentProcess
01618 process.subProcess = cms.SubProcess( process = childProcess, SelectEvents = cms.untracked.PSet(
01619 
01620 ), outputCommands = cms.untracked.vstring())
01621 """
01622             equalD = equalD.replace("parentProcess","parentProcess"+str(hash(process.subProcess)))
01623             self.assertEqual(d,equalD)
01624             p = TestMakePSet()
01625             process.subProcess.insertInto(p,"dummy")
01626             self.assertEqual((True,['a']),p.values["@sub_process"][1].values["process"][1].values['@all_modules'])
01627             self.assertEqual((True,['p']),p.values["@sub_process"][1].values["process"][1].values['@paths'])
            self.assertEqual({'@service_type':(True,'Foo')}, p.values["@sub_process"][1].values["process"][1].values["services"][1][0].values)
def Config::TestModuleCommand::testTypedParameterizable (   self)

Definition at line 1113 of file Config.py.

01114                                           :
01115             p = _TypedParameterizable("blah", b=int32(1))
01116             #see if copy works deeply
01117             other = p.copy()
01118             other.b = 2
01119             self.assertNotEqual(p.b,other.b)

def Config::TestModuleCommand::testUsing (   self)

Definition at line 1475 of file Config.py.

01476                            :
01477             p = Process('test')
01478             p.block = PSet(a = int32(1))
01479             p.modu = EDAnalyzer('Analyzer', p.block, b = int32(2))
01480             self.assertEqual(p.modu.a.value(),1)
01481             self.assertEqual(p.modu.b.value(),2)


Member Data Documentation

tuple Config::TestModuleCommand::d = p.dumpPython() [static]

Definition at line 1289 of file Config.py.

tuple Config::TestModuleCommand::p = Process("test") [static]

Definition at line 1282 of file Config.py.

Definition at line 1285 of file Config.py.