test
CMS 3D CMS Logo

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

Public Member Functions

def setUp
 
def testCloning
 
def testContains
 
def testJetCollectionString
 
def testListModules
 
def testMassSearchReplaceParam
 

Detailed Description

Definition at line 274 of file HiHelperTools.py.

Member Function Documentation

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

Definition at line 275 of file HiHelperTools.py.

276  def setUp(self):
277  """Nothing to do """
pass
def HiHelperTools.TestModuleCommand.testCloning (   self)

Definition at line 278 of file HiHelperTools.py.

279  def testCloning(self):
280  p = cms.Process("test")
281  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
282  p.b = cms.EDProducer("b", src=cms.InputTag("a"))
283  p.c = cms.EDProducer("c", src=cms.InputTag("b","instance"))
284  p.s = cms.Sequence(p.a*p.b*p.c *p.a)
285  cloneProcessingSnippet(p, p.s, "New")
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
def HiHelperTools.TestModuleCommand.testContains (   self)

Definition at line 286 of file HiHelperTools.py.

References HiHelperTools.contains().

287  def testContains(self):
288  p = cms.Process("test")
289  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
290  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
291  p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
292  p.s1 = cms.Sequence(p.a*p.b*p.c)
293  p.s2 = cms.Sequence(p.b*p.c)
294  self.assert_( contains(p.s1, "a") )
self.assert_( not contains(p.s2, "a") )
def HiHelperTools.TestModuleCommand.testJetCollectionString (   self)

Definition at line 295 of file HiHelperTools.py.

References HiHelperTools.jetCollectionString().

296  def testJetCollectionString(self):
297  self.assertEqual(jetCollectionString(algo = 'Foo', type = 'Bar'), 'patFooBarJets')
self.assertEqual(jetCollectionString(prefix = 'prefix', algo = 'Foo', type = 'Bar'), 'prefixPatFooBarJets')
def HiHelperTools.TestModuleCommand.testListModules (   self)

Definition at line 298 of file HiHelperTools.py.

References HiHelperTools.listModules().

299  def testListModules(self):
300  p = cms.Process("test")
301  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
302  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
303  p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
304  p.s = cms.Sequence(p.a*p.b*p.c)
self.assertEqual([p.a,p.b,p.c], listModules(p.s))
def HiHelperTools.TestModuleCommand.testMassSearchReplaceParam (   self)

Definition at line 305 of file HiHelperTools.py.

References HiHelperTools.massSearchReplaceParam().

306  def testMassSearchReplaceParam(self):
307  p = cms.Process("test")
308  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
309  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
310  p.c = cms.EDProducer("ac", src=cms.InputTag("b"),
311  nested = cms.PSet(src = cms.InputTag("c"))
312  )
313  p.s = cms.Sequence(p.a*p.b*p.c)
314  massSearchReplaceParam(p.s,"src",cms.InputTag("b"),"a")
315  self.assertEqual(cms.InputTag("a"),p.c.src)
316  self.assertNotEqual(cms.InputTag("a"),p.c.nested.src)
317 
unittest.main()
def massSearchReplaceParam