CMS 3D CMS Logo

Public Member Functions

helpers::TestModuleCommand Class Reference

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 261 of file helpers.py.


Member Function Documentation

def helpers::TestModuleCommand::setUp (   self)
Nothing to do 

Definition at line 262 of file helpers.py.

00263                       :
00264            """Nothing to do """
           pass
def helpers::TestModuleCommand::testCloning (   self)

Definition at line 265 of file helpers.py.

00266                             :
00267            p = cms.Process("test")
00268            p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
00269            p.b = cms.EDProducer("b", src=cms.InputTag("a"))
00270            p.c = cms.EDProducer("c", src=cms.InputTag("b","instance"))
00271            p.s = cms.Sequence(p.a*p.b*p.c *p.a)
00272            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 helpers::TestModuleCommand::testContains (   self)

Definition at line 273 of file helpers.py.

00274                              :
00275            p = cms.Process("test")
00276            p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
00277            p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
00278            p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
00279            p.s1 = cms.Sequence(p.a*p.b*p.c)
00280            p.s2 = cms.Sequence(p.b*p.c)
00281            self.assert_( contains(p.s1, "a") )
           self.assert_( not contains(p.s2, "a") )
def helpers::TestModuleCommand::testJetCollectionString (   self)

Definition at line 282 of file helpers.py.

00283                                         :
00284            self.assertEqual(jetCollectionString(algo = 'Foo', type = 'Bar'), 'patFooBarJets')
           self.assertEqual(jetCollectionString(prefix = 'prefix', algo = 'Foo', type = 'Bar'), 'prefixPatFooBarJets')
def helpers::TestModuleCommand::testListModules (   self)

Definition at line 285 of file helpers.py.

00286                                 :
00287            p = cms.Process("test")
00288            p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
00289            p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
00290            p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
00291            p.s = cms.Sequence(p.a*p.b*p.c)
           self.assertEqual([p.a,p.b,p.c], listModules(p.s))
def helpers::TestModuleCommand::testMassSearchReplaceParam (   self)

Definition at line 292 of file helpers.py.

00293                                            :
00294            p = cms.Process("test")
00295            p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
00296            p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
00297            p.c = cms.EDProducer("ac", src=cms.InputTag("b"),
00298                                 nested = cms.PSet(src = cms.InputTag("c"))
00299                                )
00300            p.s = cms.Sequence(p.a*p.b*p.c)
00301            massSearchReplaceParam(p.s,"src",cms.InputTag("b"),"a")
00302            self.assertEqual(cms.InputTag("a"),p.c.src)
00303            self.assertNotEqual(cms.InputTag("a"),p.c.nested.src)
00304            
   unittest.main()