CMS 3D CMS Logo

List of all members | Public Member Functions
config_test.ConfigTestCase Class Reference
Inheritance diagram for config_test.ConfigTestCase:

Public Member Functions

def test_analyzer (self)
 
def test_config (self)
 
def test_copy (self)
 
def test_MCComponent (self)
 

Detailed Description

Definition at line 9 of file config_test.py.

Member Function Documentation

◆ test_analyzer()

def config_test.ConfigTestCase.test_analyzer (   self)

Definition at line 11 of file config_test.py.

References resolutioncreator_cfi.object.

11  def test_analyzer(self):
12  class Ana1(object):
13  pass
14  ana1 = Analyzer(
15  Ana1,
16  toto = '1',
17  tata = 'a'
18  )
19  # checking that the analyzer name does not contain a slash,
20  # to make sure the output directory name does not contain a subdirectory
21  self.assertTrue( '/' not in ana1.name )
22 

◆ test_config()

def config_test.ConfigTestCase.test_config (   self)

Definition at line 34 of file config_test.py.

References resolutioncreator_cfi.object.

34  def test_config(self):
35  class Ana1(object):
36  pass
37  ana1 = Analyzer(
38  Ana1,
39  toto = '1',
40  tata = 'a'
41  )
42  comp1 = Component(
43  'comp1',
44  files='*.root',
45  triggers='HLT_stuff'
46  )
47  from PhysicsTools.HeppyCore.framework.chain import Chain as Events
48  config = Config( components = [comp1],
49  sequence = [ana1],
50  services = [],
51  events_class = Events )
52 
Definition: Config.py:1

◆ test_copy()

def config_test.ConfigTestCase.test_copy (   self)

Definition at line 53 of file config_test.py.

References resolutioncreator_cfi.object.

53  def test_copy(self):
54  class Ana1(object):
55  pass
56  ana1 = Analyzer(
57  Ana1,
58  instance_label = 'inst1',
59  toto = '1',
60  )
61  ana2 = copy.copy(ana1)
62  ana2.instance_label = 'inst2'
63  ana2.toto2 = '2'
64  self.assertEqual(ana2.name, '__main__.Ana1_inst2')
65  self.assertEqual(ana2.toto2, '2')
66 

◆ test_MCComponent()

def config_test.ConfigTestCase.test_MCComponent (   self)

Definition at line 23 of file config_test.py.

23  def test_MCComponent(self):
24  DYJets = MCComponent(
25  name = 'DYJets',
26  files ='blah_mc.root',
27  xSection = 3048.,
28  nGenEvents = 34915945,
29  triggers = ['HLT_MC'],
30  vertexWeight = 1.,
31  effCorrFactor = 1 )
32  self.assertTrue(True)
33