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 274 of file helpers.py.


Member Function Documentation

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

Definition at line 275 of file helpers.py.

00276                       :
00277            """Nothing to do """
           pass
def helpers::TestModuleCommand::testCloning (   self)

Definition at line 278 of file helpers.py.

00279                             :
00280            p = cms.Process("test")
00281            p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
00282            p.b = cms.EDProducer("b", src=cms.InputTag("a"))
00283            p.c = cms.EDProducer("c", src=cms.InputTag("b","instance"))
00284            p.s = cms.Sequence(p.a*p.b*p.c *p.a)
00285            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 286 of file helpers.py.

00287                              :
00288            p = cms.Process("test")
00289            p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
00290            p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
00291            p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
00292            p.s1 = cms.Sequence(p.a*p.b*p.c)
00293            p.s2 = cms.Sequence(p.b*p.c)
00294            self.assert_( contains(p.s1, "a") )
           self.assert_( not contains(p.s2, "a") )
def helpers::TestModuleCommand::testJetCollectionString (   self)

Definition at line 295 of file helpers.py.

00296                                         :
00297            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 298 of file helpers.py.

00299                                 :
00300            p = cms.Process("test")
00301            p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
00302            p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
00303            p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
00304            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 305 of file helpers.py.

00306                                            :
00307            p = cms.Process("test")
00308            p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
00309            p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
00310            p.c = cms.EDProducer("ac", src=cms.InputTag("b"),
00311                                 nested = cms.PSet(src = cms.InputTag("c"))
00312                                )
00313            p.s = cms.Sequence(p.a*p.b*p.c)
00314            massSearchReplaceParam(p.s,"src",cms.InputTag("b"),"a")
00315            self.assertEqual(cms.InputTag("a"),p.c.src)
00316            self.assertNotEqual(cms.InputTag("a"),p.c.nested.src)
00317            
   unittest.main()