CMS 3D CMS Logo

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

Public Member Functions

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

Detailed Description

Definition at line 365 of file helpers.py.

Member Function Documentation

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

Definition at line 366 of file helpers.py.

366  def setUp(self):
367  """Nothing to do """
368  pass
def helpers.TestModuleCommand.testCloning (   self)

Definition at line 369 of file helpers.py.

369  def testCloning(self):
370  p = cms.Process("test")
371  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
372  p.b = cms.EDProducer("b", src=cms.InputTag("a"))
373  p.c = cms.EDProducer("c", src=cms.InputTag("b","instance"))
374  p.s = cms.Sequence(p.a*p.b*p.c *p.a)
375  cloneProcessingSnippet(p, p.s, "New", addToTask = True)
376  self.assertEqual(p.dumpPython(),
377 """import FWCore.ParameterSet.Config as cms
378 
379 process = cms.Process("test")
380 
381 process.a = cms.EDProducer("a",
382  src = cms.InputTag("gen")
383 )
384 
385 
386 process.aNew = cms.EDProducer("a",
387  src = cms.InputTag("gen")
388 )
389 
390 
391 process.b = cms.EDProducer("b",
392  src = cms.InputTag("a")
393 )
394 
395 
396 process.bNew = cms.EDProducer("b",
397  src = cms.InputTag("aNew")
398 )
399 
400 
401 process.c = cms.EDProducer("c",
402  src = cms.InputTag("b","instance")
403 )
404 
405 
406 process.cNew = cms.EDProducer("c",
407  src = cms.InputTag("bNew","instance")
408 )
409 
410 
411 process.patAlgosToolsTask = cms.Task(process.aNew, process.bNew, process.cNew)
412 
413 
414 process.s = cms.Sequence(process.a+process.b+process.c+process.a)
415 
416 
417 process.sNew = cms.Sequence(process.aNew+process.bNew+process.cNew+process.aNew)
418 
419 
420 """)
def cloneProcessingSnippet(process, sequence, postfix, removePostfix="", noClones=[], addToTask=False)
Definition: helpers.py:255
def helpers.TestModuleCommand.testContains (   self)

Definition at line 421 of file helpers.py.

References helpers.contains().

421  def testContains(self):
422  p = cms.Process("test")
423  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
424  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
425  p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
426  p.s1 = cms.Sequence(p.a*p.b*p.c)
427  p.s2 = cms.Sequence(p.b*p.c)
428  self.assert_( contains(p.s1, "a") )
429  self.assert_( not contains(p.s2, "a") )
def contains(sequence, moduleName)
Definition: helpers.py:239
def helpers.TestModuleCommand.testJetCollectionString (   self)

Definition at line 430 of file helpers.py.

References helpers.jetCollectionString().

431  self.assertEqual(jetCollectionString(algo = 'Foo', type = 'Bar'), 'patJetsFooBar')
432  self.assertEqual(jetCollectionString(prefix = 'prefix', algo = 'Foo', type = 'Bar'), 'prefixPatJetsFooBar')
def jetCollectionString(prefix='', algo='', type='')
Definition: helpers.py:215
def testJetCollectionString(self)
Definition: helpers.py:430
def helpers.TestModuleCommand.testListModules (   self)

Definition at line 433 of file helpers.py.

References helpers.listModules().

433  def testListModules(self):
434  p = cms.Process("test")
435  p.a = cms.EDProducer("a", src=cms.InputTag("gen"))
436  p.b = cms.EDProducer("ab", src=cms.InputTag("a"))
437  p.c = cms.EDProducer("ac", src=cms.InputTag("b"))
438  p.s = cms.Sequence(p.a*p.b*p.c)
439  self.assertEqual([p.a,p.b,p.c], listModules(p.s))
440 
441  unittest.main()
def listModules(sequence)
Definition: helpers.py:205
def testListModules(self)
Definition: helpers.py:433