CMS 3D CMS Logo

Public Member Functions

Modules::TestModules Class Reference

List of all members.

Public Member Functions

def testEDAnalyzer
def testESPrefer
def testSequences
def testService

Detailed Description

Definition at line 200 of file Modules.py.


Member Function Documentation

def Modules::TestModules::testEDAnalyzer (   self)

Definition at line 201 of file Modules.py.

00202                                 :
00203             empty = EDAnalyzer("Empty")
00204             withParam = EDAnalyzer("Parameterized",foo=untracked(int32(1)), bar = untracked(string("it")))
00205             self.assertEqual(withParam.foo.value(), 1)
00206             self.assertEqual(withParam.bar.value(), "it")
00207             aCopy = withParam.copy()
00208             self.assertEqual(aCopy.foo.value(), 1)
00209             self.assertEqual(aCopy.bar.value(), "it")
00210             withType = EDAnalyzer("Test",type = int32(1))
00211             self.assertEqual(withType.type.value(),1)
00212             block = PSet(i = int32(9))
00213             m = EDProducer("DumbProducer", block, j = int32(10))
00214             self.assertEqual(9, m.i.value())
            self.assertEqual(10, m.j.value())
def Modules::TestModules::testESPrefer (   self)

Definition at line 215 of file Modules.py.

00216                               :
00217             juicer = ESPrefer("JuiceProducer")
00218             options = PrintOptions()
00219             options.isCfg = True
00220             self.assertEqual(juicer.dumpPythonAs("juicer", options), "process.prefer(\"JuiceProducer\")\n")
00221             options.isCfg = False
00222             self.assertEqual(juicer.dumpPythonAs("juicer", options), "es_prefer_JuiceProducer = cms.ESPrefer(\"JuiceProducer\")\n")
00223 
00224             juicer = ESPrefer("JuiceProducer","juicer")
00225             options = PrintOptions()
00226             options.isCfg = True
00227             self.assertEqual(juicer.dumpPythonAs("juicer", options), 'process.prefer("juicer")\n')
00228             options.isCfg = False
00229             self.assertEqual(juicer.dumpPythonAs("juicer", options), 'es_prefer_juicer = cms.ESPrefer("JuiceProducer","juicer")\n')
00230             juicer = ESPrefer("JuiceProducer",fooRcd=vstring())
00231             self.assertEqual(juicer.dumpConfig(options),
00232 """JuiceProducer { 
00233     vstring fooRcd = {
00234     }
00235 
00236 }
00237 """)
00238             options = PrintOptions()
00239             options.isCfg = True
00240             self.assertEqual(juicer.dumpPythonAs("juicer"),
00241 """process.prefer("JuiceProducer",
00242     fooRcd = cms.vstring()
00243 )
00244 """)
00245             options.isCfg = False
00246             self.assertEqual(juicer.dumpPythonAs("juicer", options),
00247 """es_prefer_JuiceProducer = cms.ESPrefer("JuiceProducer",
00248     fooRcd = cms.vstring()
00249 )
00250 """)
        
def Modules::TestModules::testSequences (   self)

Definition at line 258 of file Modules.py.

00259                                :
00260             m = EDProducer("MProducer")
00261             n = EDProducer("NProducer")
00262             m.setLabel("m")
00263             n.setLabel("n")
00264             s1 = Sequence(m*n)
00265             options = PrintOptions()
00266 
00267 
00268 
    unittest.main()
def Modules::TestModules::testService (   self)

Definition at line 251 of file Modules.py.

00252                              :
00253             empty = Service("Empty")
00254             withParam = Service("Parameterized",foo=untracked(int32(1)), bar = untracked(string("it")))
00255             self.assertEqual(withParam.foo.value(), 1)
00256             self.assertEqual(withParam.bar.value(), "it")
00257             self.assertEqual(empty.dumpPython(), "cms.Service(\"Empty\")\n")
            self.assertEqual(withParam.dumpPython(), "cms.Service(\"Parameterized\",\n    foo = cms.untracked.int32(1),\n    bar = cms.untracked.string(\'it\')\n)\n")