CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
Utilities.TestModuleCommand Class Reference
Inheritance diagram for Utilities.TestModuleCommand:

Public Member Functions

def setup
 
def testConvertToSingleModuleEndPaths
 
def testCreateTaskWithAllProducersAndFilters
 
def testIgnoreFiltersOnPath
 

Detailed Description

Definition at line 107 of file Utilities.py.

Member Function Documentation

def Utilities.TestModuleCommand.setup (   self)

Definition at line 108 of file Utilities.py.

109  def setup(self):
None
def Utilities.TestModuleCommand.testConvertToSingleModuleEndPaths (   self)

Definition at line 153 of file Utilities.py.

References Utilities.convertToSingleModuleEndPaths().

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

Definition at line 128 of file Utilities.py.

References Utilities.createTaskWithAllProducersAndFilters().

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

Definition at line 110 of file Utilities.py.

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