654 process = cms.Process(
'unittest')
655 process.source=
Source(
"PoolSource",fileNames = cms.untracked.string(
"file:file.root"))
657 changeSource(process,
"file:filename.root")
658 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename.root")
660 changeSource(process,
"file:filename2.root")
661 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename2.root")
663 changeSource(process,
"file:filename3.root")
664 self.assertEqual(changeSource._parameters[
'source'].value,
"file:filename3.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\n")
668 process.source.fileNames=cms.untracked.vstring(
"file:replacedfile.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\nprocess.source.fileNames = cms.untracked.vstring('file:replacedfile.root')\n")
671 process.disableRecording()
672 changeSource.setParameter(
'source',
"file:filename4.root")
673 action=changeSource.__copy__()
674 process.addAction(action)
675 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")
677 process.enableRecording()
678 changeSource.setParameter(
'source',
"file:filename5.root")
679 action=changeSource.__copy__()
680 process.addAction(action)
681 process.deleteAction(3)
682 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")
684 process.deleteAction(0)
685 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)