CMS 3D CMS Logo

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

Public Member Functions

def setUp (self)
 
def testCloning (self)
 
def testContains (self)
 
def testJetCollectionString (self)
 
def testListModules (self)
 

Detailed Description

Definition at line 182 of file HiHelperTools.py.

Member Function Documentation

def HiHelperTools.TestModuleCommand.setUp (   self)
Nothing to do 

Definition at line 183 of file HiHelperTools.py.

183  def setUp(self):
184  """Nothing to do """
185  pass
def HiHelperTools.TestModuleCommand.testCloning (   self)

Definition at line 186 of file HiHelperTools.py.

186  def testCloning(self):
187  p = cms.Process("test")
188  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
189  p.b = cms.EDProducer("b", src=cms.InputTag("a"))
190  p.c = cms.EDProducer("c", src=cms.InputTag("b","instance"))
191  p.s = cms.Sequence(p.a*p.b*p.c *p.a)
192  cloneProcessingSnippet(p, p.s, "New")
193  self.assertEqual(p.dumpPython(),'import FWCore.ParameterSet.Config as cms\n\nprocess = cms.Process("test")\n\nprocess.a = cms.EDProducer("a",\n src = cms.InputTag("gen")\n)\n\n\nprocess.c = cms.EDProducer("c",\n src = cms.InputTag("b","instance")\n)\n\n\nprocess.cNew = cms.EDProducer("c",\n src = cms.InputTag("bNew","instance")\n)\n\n\nprocess.bNew = cms.EDProducer("b",\n src = cms.InputTag("aNew")\n)\n\n\nprocess.aNew = cms.EDProducer("a",\n src = cms.InputTag("gen")\n)\n\n\nprocess.b = cms.EDProducer("b",\n src = cms.InputTag("a")\n)\n\n\nprocess.s = cms.Sequence(process.a*process.b*process.c*process.a)\n\n\nprocess.sNew = cms.Sequence(process.aNew+process.bNew+process.cNew)\n\n\n')
def cloneProcessingSnippet(process, sequence, postfix)
def HiHelperTools.TestModuleCommand.testContains (   self)

Definition at line 194 of file HiHelperTools.py.

References HiHelperTools.contains().

194  def testContains(self):
195  p = cms.Process("test")
196  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
197  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
198  p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
199  p.s1 = cms.Sequence(p.a*p.b*p.c)
200  p.s2 = cms.Sequence(p.b*p.c)
201  self.assert_( contains(p.s1, "a") )
202  self.assert_( not contains(p.s2, "a") )
def contains(sequence, moduleName)
def HiHelperTools.TestModuleCommand.testJetCollectionString (   self)

Definition at line 203 of file HiHelperTools.py.

References HiHelperTools.jetCollectionString().

204  self.assertEqual(jetCollectionString(algo = 'Foo', type = 'Bar'), 'patFooBarJets')
205  self.assertEqual(jetCollectionString(prefix = 'prefix', algo = 'Foo', type = 'Bar'), 'prefixPatFooBarJets')
def jetCollectionString(prefix='', algo='', type='')
def HiHelperTools.TestModuleCommand.testListModules (   self)

Definition at line 206 of file HiHelperTools.py.

References HiHelperTools.listModules().

206  def testListModules(self):
207  p = cms.Process("test")
208  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
209  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
210  p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
211  p.s = cms.Sequence(p.a*p.b*p.c)
212  self.assertEqual([p.a,p.b,p.c], listModules(p.s))
213 
214  unittest.main()
def listModules(sequence)