CMS 3D CMS Logo

List of all members | Public Member Functions
CmsRun.testCmsRun Class Reference
Inheritance diagram for CmsRun.testCmsRun:

Public Member Functions

def testFiltering (self)
 

Detailed Description

Definition at line 27 of file CmsRun.py.

Member Function Documentation

◆ testFiltering()

def CmsRun.testCmsRun.testFiltering (   self)

Definition at line 28 of file CmsRun.py.

28  def testFiltering(self):
29  import FWCore.ParameterSet.Config as cms
30  process = cms.Process("Test")
31  process.source = cms.Source("EmptySource")
32  nEvents=10
33  process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(nEvents))
34  process.scale = cms.EDFilter("Prescaler",prescaleFactor = cms.int32(1), prescaleOffset = cms.int32(0))
35  process.p = cms.Path(process.scale)
36  filterResults = ((10,0),(5,5),(3,7))
37  for x in [1,2,3]:
38  process.scale.prescaleFactor = x
39  e = CmsRun(process)
40  e.run()
41  self.assertEqual(e.totalEvents(),nEvents)
42  self.assertEqual(e.totalEventsPassed(),filterResults[x-1][0])
43  self.assertEqual(e.totalEventsFailed(),filterResults[x-1][1])
44  del e
45 
46  unittest.main()
CmsRun
Definition: CmsRun.py:1