CMS 3D CMS Logo

List of all members | Public Member Functions
Utilities.TestModuleCommand Class Reference
Inheritance diagram for Utilities.TestModuleCommand:

Public Member Functions

def setup (self)
 
def testConvertToSingleModuleEndPaths (self)
 
def testCreateTaskWithAllProducersAndFilters (self)
 
def testIgnoreFiltersOnPath (self)
 

Detailed Description

Definition at line 109 of file Utilities.py.

Member Function Documentation

◆ setup()

def Utilities.TestModuleCommand.setup (   self)

Definition at line 110 of file Utilities.py.

110  def setup(self):
111  None

◆ testConvertToSingleModuleEndPaths()

def Utilities.TestModuleCommand.testConvertToSingleModuleEndPaths (   self)

Definition at line 155 of file Utilities.py.

155  def testConvertToSingleModuleEndPaths(self):
156  import FWCore.ParameterSet.Config as cms
157  process = cms.Process("TEST")
158  process.a = cms.EDAnalyzer("A")
159  process.b = cms.EDAnalyzer("B")
160  process.c = cms.EDProducer("C")
161  process.ep = cms.EndPath(process.a+process.b,cms.Task(process.c))
162  self.assertEqual(process.ep.dumpPython(),'cms.EndPath(process.a+process.b, cms.Task(process.c))\n')
164  self.assertEqual(False,hasattr(process,"ep"))
165  self.assertEqual(process.a_endpath.dumpPython(),'cms.EndPath(process.a, cms.Task(process.c))\n')
166  self.assertEqual(process.b_endpath.dumpPython(),'cms.EndPath(process.b, cms.Task(process.c))\n')
167 
168  unittest.main()

References Utilities.convertToSingleModuleEndPaths().

◆ testCreateTaskWithAllProducersAndFilters()

def Utilities.TestModuleCommand.testCreateTaskWithAllProducersAndFilters (   self)

Definition at line 130 of file Utilities.py.

130  def testCreateTaskWithAllProducersAndFilters(self):
131 
132  import FWCore.ParameterSet.Config as cms
133  process = cms.Process("TEST")
134 
135  process.a = cms.EDProducer("AProd")
136  process.b = cms.EDProducer("BProd")
137  process.c = cms.EDProducer("CProd")
138 
139  process.f1 = cms.EDFilter("Filter")
140  process.f2 = cms.EDFilter("Filter2")
141  process.f3 = cms.EDFilter("Filter3")
142 
143  process.out1 = cms.OutputModule("Output1")
144  process.out2 = cms.OutputModule("Output2")
145 
146  process.analyzer1 = cms.EDAnalyzer("analyzerType1")
147  process.analyzer2 = cms.EDAnalyzer("analyzerType2")
148 
149  process.task = createTaskWithAllProducersAndFilters(process)
150  process.path = cms.Path(process.a, process.task)
151 
152  self.assertEqual(process.task.dumpPython(),'cms.Task(process.a, process.b, process.c, process.f1, process.f2, process.f3)\n')
153  self.assertEqual(process.path.dumpPython(),'cms.Path(process.a, process.task)\n')
154 

References Utilities.createTaskWithAllProducersAndFilters().

◆ testIgnoreFiltersOnPath()

def Utilities.TestModuleCommand.testIgnoreFiltersOnPath (   self)

Definition at line 112 of file Utilities.py.

112  def testIgnoreFiltersOnPath(self):
113  import FWCore.ParameterSet.Config as cms
114  process = cms.Process("Test")
115 
116  process.f1 = cms.EDFilter("F1")
117  process.f2 = cms.EDFilter("F2")
118  process.f3 = cms.EDFilter("F3")
119  process.f4 = cms.EDFilter("F4")
120  process.f5 = cms.EDFilter("F5")
121  process.f6 = cms.EDFilter("F6")
122  process.t1 = cms.Task(process.f5)
123  process.t2 = cms.Task(process.f6)
124  process.s = cms.Sequence(process.f4, process.t1)
125 
126  process.p = cms.Path(process.f1+cms.ignore(process.f2)+process.f3+process.s, process.t2)
127  ignoreAllFiltersOnPath(process.p)
128  self.assertEqual(process.p.dumpPython(),'cms.Path(cms.ignore(process.f1)+cms.ignore(process.f2)+cms.ignore(process.f3)+cms.ignore(process.f4), process.t1, process.t2)\n')
129 
Utilities.ignoreAllFiltersOnPath
def ignoreAllFiltersOnPath(path)
Definition: Utilities.py:2
Utilities.createTaskWithAllProducersAndFilters
def createTaskWithAllProducersAndFilters(process)
Definition: Utilities.py:62
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
Utilities.convertToSingleModuleEndPaths
def convertToSingleModuleEndPaths(process)
Definition: Utilities.py:70