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 183 of file HiHelperTools.py.

Member Function Documentation

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

Definition at line 184 of file HiHelperTools.py.

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

Definition at line 187 of file HiHelperTools.py.

187  def testCloning(self):
188  p = cms.Process("test")
189  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
190  p.b = cms.EDProducer("b", src=cms.InputTag("a"))
191  p.c = cms.EDProducer("c", src=cms.InputTag("b","instance"))
192  p.s = cms.Sequence(p.a*p.b*p.c *p.a)
193  cloneProcessingSnippet(p, p.s, "New")
194  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 195 of file HiHelperTools.py.

References HiHelperTools.contains().

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

Definition at line 204 of file HiHelperTools.py.

References HiHelperTools.jetCollectionString().

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

Definition at line 207 of file HiHelperTools.py.

References HiHelperTools.listModules().

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