CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
CmsRun.testCmsRun Class Reference
Inheritance diagram for CmsRun.testCmsRun:

Public Member Functions

def testFiltering
 

Detailed Description

Definition at line 27 of file CmsRun.py.

Member Function Documentation

def CmsRun.testCmsRun.testFiltering (   self)

Definition at line 28 of file CmsRun.py.

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