Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:29:04

0001 from FWCore.PythonFramework.CmsRun import CmsRun
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 process = cms.Process("Test")
0005 
0006 process.source = cms.Source("EmptySource")
0007 
0008 nEvents = 10
0009 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(nEvents))
0010 
0011 var = 5
0012 outList = []
0013 
0014 process.m = cms.EDProducer("edmtest::PythonTestProducer", inputVariable = cms.string("var"),
0015                             outputListVariable = cms.string("outList"),
0016                             source = cms.InputTag("ints"))
0017 
0018 process.ints = cms.EDProducer("IntProducer", ivalue = cms.int32(1))
0019 process.p = cms.Path(process.m, cms.Task(process.ints))
0020 
0021 cmsRun = CmsRun(process)
0022 
0023 cmsRun.run()
0024 
0025 assert (outList == [1]*nEvents)
0026