651 process = cms.Process(
'unittest')
652 process.source=
Source(
"PoolSource",fileNames = cms.untracked.string(
"file:file.root"))
654 changeSource(process,
"file:filename.root")
655 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename.root")
657 changeSource(process,
"file:filename2.root")
658 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename2.root")
660 changeSource(process,
"file:filename3.root")
661 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename3.root")
663 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")
665 process.source.fileNames=cms.untracked.vstring(
"file:replacedfile.root")
666 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")
668 process.disableRecording()
669 changeSource.setParameter(
'source',
"file:filename4.root")
670 action=changeSource.__copy__()
671 process.addAction(action)
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.enableRecording()
675 changeSource.setParameter(
'source',
"file:filename5.root")
676 action=changeSource.__copy__()
677 process.addAction(action)
678 process.deleteAction(3)
679 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")
681 process.deleteAction(0)
682 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)