657 process = cms.Process(
'unittest')
658 process.source=
Source(
"PoolSource",fileNames = cms.untracked.string(
"file:file.root"))
660 changeSource(process,
"file:filename.root")
661 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename.root")
663 changeSource(process,
"file:filename2.root")
664 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename2.root")
666 changeSource(process,
"file:filename3.root")
667 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename3.root")
669 self.assertEqual(process.dumpHistory(),
"\nfrom FWCore.GuiBrowsers.editorTools import *\n\nchangeSource(process , 'file:filename.root')\n\n\nchangeSource(process , 'file:filename2.root')\n\n\nchangeSource(process , 'file:filename3.root')\n\n")
671 process.source.fileNames=cms.untracked.vstring(
"file:replacedfile.root")
672 self.assertEqual(process.dumpHistory(),
"\nfrom FWCore.GuiBrowsers.editorTools import *\n\nchangeSource(process , 'file:filename.root')\n\n\nchangeSource(process , 'file:filename2.root')\n\n\nchangeSource(process , 'file:filename3.root')\n\nprocess.source.fileNames = cms.untracked.vstring('file:replacedfile.root')\n")
674 process.disableRecording()
675 changeSource.setParameter(
'source',
"file:filename4.root")
676 action=changeSource.__copy__()
677 process.addAction(action)
678 self.assertEqual(process.dumpHistory(),
"\nfrom FWCore.GuiBrowsers.editorTools import *\n\nchangeSource(process , 'file:filename.root')\n\n\nchangeSource(process , 'file:filename2.root')\n\n\nchangeSource(process , 'file:filename3.root')\n\nprocess.source.fileNames = cms.untracked.vstring('file:replacedfile.root')\n")
680 process.enableRecording()
681 changeSource.setParameter(
'source',
"file:filename5.root")
682 action=changeSource.__copy__()
683 process.addAction(action)
684 process.deleteAction(3)
685 self.assertEqual(process.dumpHistory(),
"\nfrom FWCore.GuiBrowsers.editorTools import *\n\nchangeSource(process , 'file:filename.root')\n\n\nchangeSource(process , 'file:filename2.root')\n\n\nchangeSource(process , 'file:filename3.root')\n\n\nchangeSource(process , 'file:filename5.root')\n\n")
687 process.deleteAction(0)
688 self.assertEqual(process.dumpHistory(),
"\nfrom FWCore.GuiBrowsers.editorTools import *\n\nchangeSource(process , 'file:filename2.root')\n\n\nchangeSource(process , 'file:filename3.root')\n\n\nchangeSource(process , 'file:filename5.root')\n\n")
def testdumpHistory(self)