ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.TestCases.DQCTestCase Class Reference
Inheritance diagram for python.TestCases.DQCTestCase:
Collaboration diagram for python.TestCases.DQCTestCase:

Public Member Functions

def setUp (self)
 
def do_imports (self, verbose=False)
 
def test_01_ConfigsReadable (self)
 
def test_02_ConfigsHaveConfigs (self)
 
def test_03_ConfigsPointAtGoodFiles (self)
 
def test_04_ModuleHandling (self)
 

Public Attributes

 modlist
 

Detailed Description

Definition at line 8 of file DataQualityConfigurations/python/TestCases.py.

Member Function Documentation

◆ do_imports()

def python.TestCases.DQCTestCase.do_imports (   self,
  verbose = False 
)

Definition at line 12 of file DataQualityConfigurations/python/TestCases.py.

12  def do_imports(self, verbose=False):
13  import DataQualityConfigurations
14  for i in DataQualityConfigurations.__all__:
15  if verbose: print ('Importing', i)
16  modname = 'DataQualityConfigurations.%s' % i
17  __import__(modname)
18  self.modlist.append(sys.modules[modname])
19 

◆ setUp()

def python.TestCases.DQCTestCase.setUp (   self)

Definition at line 9 of file DataQualityConfigurations/python/TestCases.py.

9  def setUp(self):
10  self.modlist = []
11 

◆ test_01_ConfigsReadable()

def python.TestCases.DQCTestCase.test_01_ConfigsReadable (   self)
Test that we can read the python config files ok

Definition at line 20 of file DataQualityConfigurations/python/TestCases.py.

20  def test_01_ConfigsReadable(self):
21  '''Test that we can read the python config files ok'''
22  self.do_imports(verbose=True)
23  self.assert_(len(self.modlist) > 0, 'Should have more than one config module')
24 

◆ test_02_ConfigsHaveConfigs()

def python.TestCases.DQCTestCase.test_02_ConfigsHaveConfigs (   self)

Definition at line 25 of file DataQualityConfigurations/python/TestCases.py.

25  def test_02_ConfigsHaveConfigs(self):
26  self.do_imports()
27  for mod in self.modlist:
28  self.assert_(mod.dqconfig)
29 

◆ test_03_ConfigsPointAtGoodFiles()

def python.TestCases.DQCTestCase.test_03_ConfigsPointAtGoodFiles (   self)

Definition at line 30 of file DataQualityConfigurations/python/TestCases.py.

30  def test_03_ConfigsPointAtGoodFiles(self):
31  self.do_imports()
32  for mod in self.modlist:
33  for f in ('hcfg', 'hcfg_min10', 'hcfg_min30'):
34  mf = getattr(mod.dqconfig, f)
35  if mf != '':
36  self.failUnless(os.access(mf, os.R_OK),
37  'File %s not readable in configuration %s' % (mf, mod.__name__) )
38  self.failUnless('/afs/cern.ch/user/a/atlasdqm/dqmdisk/tier0/han_config/' in mf,
39  'Invalid location %s for a production hcfg file in %s' % (mf, mod.__name__) )
40 

◆ test_04_ModuleHandling()

def python.TestCases.DQCTestCase.test_04_ModuleHandling (   self)

Definition at line 41 of file DataQualityConfigurations/python/TestCases.py.

41  def test_04_ModuleHandling(self):
42  self.do_imports()
43  from DataQualityConfigurations import getmodule
44  # OK for modules that should explicitly be around?
45  for mod in self.modlist:
46  self.assertTrue(getmodule(mod.__name__.replace('DataQualityConfigurations.', '')))
47 
48  # OK for some modules that do not exist?
49  for mname in ('data15_hi',
50  'data15_hip',
51  'data15_900GeV',
52  'data15_2p76TeV',
53  'data15_5TeV',
54  'data15_7TeV',
55  'data15_8TeV',
56  'data15_13TeV',
57  'data15_1beam',
58  'data15_cos',
59  'data15_calib',
60  'data15_calocomm',
61  'data15_larcomm',
62  'data15_tilecomm',
63  'data15_muoncomm',
64  'data15_idcomm',
65  'data15_comm',
66  'data15',
67  ):
68  self.assertTrue(getmodule(mname))
69 
70  # Fails otherwise?
71  self.assertRaises(ValueError, getmodule, 'NonExistentPtag')
72 

Member Data Documentation

◆ modlist

python.TestCases.DQCTestCase.modlist

The documentation for this class was generated from the following file:
python.DQCDispatch.getmodule
def getmodule(modname)
Definition: DQCDispatch.py:10
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91