655 process = cms.Process(
'unittest')
656 process.source=
Source(
"PoolSource",fileNames = cms.untracked.string(
"file:file.root"))
658 changeSource(process,
"file:filename.root")
659 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename.root")
661 changeSource(process,
"file:filename2.root")
662 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename2.root")
664 changeSource(process,
"file:filename3.root")
665 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename3.root")
667 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")
669 process.source.fileNames=cms.untracked.vstring(
"file:replacedfile.root")
670 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")
672 process.disableRecording()
673 changeSource.setParameter(
'source',
"file:filename4.root")
674 action=changeSource.__copy__()
675 process.addAction(action)
676 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")
678 process.enableRecording()
679 changeSource.setParameter(
'source',
"file:filename5.root")
680 action=changeSource.__copy__()
681 process.addAction(action)
682 process.deleteAction(3)
683 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")
685 process.deleteAction(0)
686 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)