Public Member Functions | |
def | testEDAnalyzer |
def | testESPrefer |
def | testSequences |
def | testService |
Definition at line 187 of file Modules.py.
def Modules::TestModules::testEDAnalyzer | ( | self | ) |
Definition at line 188 of file Modules.py.
00188 : 00189 empty = EDAnalyzer("Empty") 00190 withParam = EDAnalyzer("Parameterized",foo=untracked(int32(1)), bar = untracked(string("it"))) 00191 self.assertEqual(withParam.foo.value(), 1) 00192 self.assertEqual(withParam.bar.value(), "it") 00193 aCopy = withParam.copy() 00194 self.assertEqual(aCopy.foo.value(), 1) 00195 self.assertEqual(aCopy.bar.value(), "it") 00196 withType = EDAnalyzer("Test",type = int32(1)) 00197 self.assertEqual(withType.type.value(),1) 00198 block = PSet(i = int32(9)) 00199 m = EDProducer("DumbProducer", block, j = int32(10)) 00200 self.assertEqual(9, m.i.value()) 00201 self.assertEqual(10, m.j.value()) def testESPrefer(self):
def Modules::TestModules::testESPrefer | ( | self | ) |
Definition at line 202 of file Modules.py.
00202 : 00203 juicer = ESPrefer("JuiceProducer") 00204 options = PrintOptions() 00205 options.isCfg = True 00206 self.assertEqual(juicer.dumpPythonAs("juicer", options), "process.prefer(\"JuiceProducer\")\n") 00207 options.isCfg = False 00208 self.assertEqual(juicer.dumpPythonAs("juicer", options), "es_prefer_JuiceProducer = cms.ESPrefer(\"JuiceProducer\")\n") 00209 00210 juicer = ESPrefer("JuiceProducer","juicer") 00211 options = PrintOptions() 00212 options.isCfg = True 00213 self.assertEqual(juicer.dumpPythonAs("juicer", options), 'process.prefer("juicer")\n') 00214 options.isCfg = False 00215 self.assertEqual(juicer.dumpPythonAs("juicer", options), 'es_prefer_juicer = cms.ESPrefer("JuiceProducer","juicer")\n') 00216 juicer = ESPrefer("JuiceProducer",fooRcd=vstring()) 00217 self.assertEqual(juicer.dumpConfig(options), 00218 """JuiceProducer { 00219 vstring fooRcd = { 00220 } 00221 00222 } 00223 """) 00224 options = PrintOptions() 00225 options.isCfg = True 00226 self.assertEqual(juicer.dumpPythonAs("juicer"), 00227 """process.prefer("JuiceProducer", 00228 fooRcd = cms.vstring() 00229 ) 00230 """) 00231 options.isCfg = False 00232 self.assertEqual(juicer.dumpPythonAs("juicer", options), 00233 """es_prefer_JuiceProducer = cms.ESPrefer("JuiceProducer", 00234 fooRcd = cms.vstring() 00235 ) 00236 """) 00237 def testService(self):
def Modules::TestModules::testSequences | ( | self | ) |
Definition at line 245 of file Modules.py.
00245 : 00246 m = EDProducer("MProducer") 00247 n = EDProducer("NProducer") 00248 m.setLabel("m") 00249 n.setLabel("n") 00250 s1 = Sequence(m*n) 00251 options = PrintOptions() 00252 print s1.dumpPython(options) 00253 00254 00255 00256 unittest.main() unittest.main()
def Modules::TestModules::testService | ( | self | ) |
Definition at line 238 of file Modules.py.
00238 : 00239 empty = Service("Empty") 00240 withParam = Service("Parameterized",foo=untracked(int32(1)), bar = untracked(string("it"))) 00241 self.assertEqual(withParam.foo.value(), 1) 00242 self.assertEqual(withParam.bar.value(), "it") 00243 self.assertEqual(empty.dumpPython(), "cms.Service(\"Empty\")\n") 00244 self.assertEqual(withParam.dumpPython(), "cms.Service(\"Parameterized\",\n foo = cms.untracked.int32(1),\n bar = cms.untracked.string(\'it\')\n)\n") def testSequences(self):