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 107 of file Utilities.py.

Member Function Documentation

◆ setup()

def Utilities.TestModuleCommand.setup (   self)

Definition at line 108 of file Utilities.py.

108  def setup(self):
109  None

◆ testConvertToSingleModuleEndPaths()

def Utilities.TestModuleCommand.testConvertToSingleModuleEndPaths (   self)

Definition at line 153 of file Utilities.py.

References Utilities.convertToSingleModuleEndPaths().

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

◆ testCreateTaskWithAllProducersAndFilters()

def Utilities.TestModuleCommand.testCreateTaskWithAllProducersAndFilters (   self)

Definition at line 128 of file Utilities.py.

References Utilities.createTaskWithAllProducersAndFilters().

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

◆ testIgnoreFiltersOnPath()

def Utilities.TestModuleCommand.testIgnoreFiltersOnPath (   self)

Definition at line 110 of file Utilities.py.

110  def testIgnoreFiltersOnPath(self):
111  import FWCore.ParameterSet.Config as cms
112  process = cms.Process("Test")
113 
114  process.f1 = cms.EDFilter("F1")
115  process.f2 = cms.EDFilter("F2")
116  process.f3 = cms.EDFilter("F3")
117  process.f4 = cms.EDFilter("F4")
118  process.f5 = cms.EDFilter("F5")
119  process.f6 = cms.EDFilter("F6")
120  process.t1 = cms.Task(process.f5)
121  process.t2 = cms.Task(process.f6)
122  process.s = cms.Sequence(process.f4, process.t1)
123 
124  process.p = cms.Path(process.f1+cms.ignore(process.f2)+process.f3+process.s, process.t2)
125  ignoreAllFiltersOnPath(process.p)
126  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')
127 
def ignoreAllFiltersOnPath(path)
Definition: Utilities.py:2