2 import FWCore.ParameterSet.Config
as cms
4 from FWCore.ParameterSet.Types
import InputTag
9 _defaultParameters=dicttypes.SortedKeysDict()
11 ConfigToolBase.__init__(self)
12 self.addParameter(self.
_defaultParameters,
'code',
'',
'User code modifying the process: e.g. process.maxevents=1')
20 return (
"",dumpPython)
22 self.setParameter(
'code',code)
33 """ Tool for changing the source of a Process;
34 Implemented for testing purposes.
38 _defaultParameters=dicttypes.SortedKeysDict()
40 ConfigToolBase.__init__(self)
41 self.addParameter(self.
_defaultParameters,
'source',
'No default value. Set your own',
' Source filenames')
51 self.setParameter(
'source',source)
56 process.source.fileNames=cms.untracked.vstring(source)
60 from FWCore.ParameterSet.Modules
import Source
62 if __name__==
'__main__':
68 process = cms.Process(
'unittest')
69 process.source=
Source(
"PoolSource",fileNames = cms.untracked.string(
"file:file.root"))
71 changeSource(process,
"file:filename.root")
72 self.assertEqual(changeSource.dumpPython(), (
'\nfrom FWCore.GuiBrowsers.editorTools import *\n',
"\nchangeSource(process , 'file:filename.root')\n"))