Public Member Functions | |
def | setup |
def | testConfig |
def | testNoSchedule |
def | testWithSchedule |
Definition at line 74 of file Utilities.py.
def Utilities::TestModuleCommand::setup | ( | self | ) |
Definition at line 75 of file Utilities.py.
def Utilities::TestModuleCommand::testConfig | ( | self | ) |
Definition at line 77 of file Utilities.py.
00078 : 00079 import FWCore.ParameterSet.Config as cms 00080 process = cms.Process("Test") 00081 00082 process.a = cms.EDProducer("A") 00083 process.b = cms.EDProducer("B") 00084 process.c = cms.EDProducer("C") 00085 00086 process.p = cms.Path(process.b*process.c) 00087 00088 process.d = cms.EDAnalyzer("D") 00089 00090 process.o = cms.OutputModule("MyOutput") 00091 process.out = cms.EndPath(process.o) 00092 removeModulesNotOnAPathExcluding(process,(process.b,)) 00093 00094 self.assert_(not hasattr(process,'a')) 00095 self.assert_(hasattr(process,'b')) 00096 self.assert_(hasattr(process,'c')) 00097 self.assert_(not hasattr(process,'d')) self.assert_(hasattr(process,'o'))
def Utilities::TestModuleCommand::testNoSchedule | ( | self | ) |
Definition at line 98 of file Utilities.py.
00099 : 00100 import FWCore.ParameterSet.Config as cms 00101 process = cms.Process("TEST") 00102 process.a = cms.EDProducer("AProd") 00103 process.b = cms.EDProducer("BProd") 00104 process.f1 = cms.EDFilter("Filter") 00105 process.f2 = cms.EDFilter("Filter2") 00106 process.p1 = cms.Path(process.a+process.b+process.f1) 00107 process.p4 = cms.Path(process.a+process.f2+process.b+process.f1) 00108 process.p2 = cms.Path(process.a+process.b) 00109 process.p3 = cms.Path(process.f1) 00110 convertToUnscheduled(process) 00111 self.assertEqual(process.options.allowUnscheduled, cms.untracked.bool(True)) 00112 self.assert_(not hasattr(process,'p2')) 00113 self.assert_(hasattr(process,'a')) 00114 self.assert_(hasattr(process,'b')) 00115 self.assert_(hasattr(process,'f1')) 00116 self.assert_(hasattr(process,'f2')) 00117 self.assertEqual(process.p1.dumpPython(None),'cms.Path(process.f1)\n') 00118 self.assertEqual(process.p3.dumpPython(None),'cms.Path(process.f1)\n') self.assertEqual(process.p4.dumpPython(None),'cms.Path(process.f2+process.f1)\n')
def Utilities::TestModuleCommand::testWithSchedule | ( | self | ) |
Definition at line 119 of file Utilities.py.
00120 : 00121 import FWCore.ParameterSet.Config as cms 00122 process = cms.Process("TEST") 00123 process.a = cms.EDProducer("AProd") 00124 process.b = cms.EDProducer("BProd") 00125 process.f1 = cms.EDFilter("Filter") 00126 process.f2 = cms.EDFilter("Filter2") 00127 process.p1 = cms.Path(process.a+process.b+process.f1) 00128 process.p4 = cms.Path(process.a+process.f2+process.b+process.f1) 00129 process.p2 = cms.Path(process.a+process.b) 00130 process.p3 = cms.Path(process.f1) 00131 process.schedule = cms.Schedule(process.p1,process.p4,process.p2,process.p3) 00132 convertToUnscheduled(process) 00133 self.assertEqual(process.options.allowUnscheduled,cms.untracked.bool(True)) 00134 self.assert_(not hasattr(process,'p2')) 00135 self.assert_(hasattr(process,'a')) 00136 self.assert_(hasattr(process,'b')) 00137 self.assert_(hasattr(process,'f1')) 00138 self.assert_(hasattr(process,'f2')) 00139 self.assertEqual(process.p1.dumpPython(None),'cms.Path(process.f1)\n') 00140 self.assertEqual(process.p3.dumpPython(None),'cms.Path(process.f1)\n') 00141 self.assertEqual(process.p4.dumpPython(None),'cms.Path(process.f2+process.f1)\n') 00142 self.assertEqual([p for p in process.schedule],[process.p1,process.p4,process.p3]) 00143 unittest.main()