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

Member Function Documentation

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

Definition at line 362 of file helpers.py.

362  def setUp(self):
363  """Nothing to do """
364  pass
def helpers.TestModuleCommand.testCloning (   self)

Definition at line 365 of file helpers.py.

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

Definition at line 417 of file helpers.py.

References helpers.contains().

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

Definition at line 426 of file helpers.py.

References helpers.jetCollectionString().

427  self.assertEqual(jetCollectionString(algo = 'Foo', type = 'Bar'), 'patJetsFooBar')
428  self.assertEqual(jetCollectionString(prefix = 'prefix', algo = 'Foo', type = 'Bar'), 'prefixPatJetsFooBar')
def jetCollectionString(prefix='', algo='', type='')
Definition: helpers.py:211
def testJetCollectionString(self)
Definition: helpers.py:426
def helpers.TestModuleCommand.testListModules (   self)

Definition at line 429 of file helpers.py.

References helpers.listModules().

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