ATLAS Offline Software
Loading...
Searching...
No Matches
python.TestCases.DQCTestCase Class Reference
Inheritance diagram for python.TestCases.DQCTestCase:
Collaboration diagram for python.TestCases.DQCTestCase:

Public Member Functions

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

Public Attributes

list modlist = []

Detailed Description

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

Member Function Documentation

◆ do_imports()

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

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

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

◆ setUp()

python.TestCases.DQCTestCase.setUp ( self)

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

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

◆ test_01_ConfigsReadable()

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

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

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

◆ test_02_ConfigsHaveConfigs()

python.TestCases.DQCTestCase.test_02_ConfigsHaveConfigs ( self)

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

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

◆ test_03_ConfigsPointAtGoodFiles()

python.TestCases.DQCTestCase.test_03_ConfigsPointAtGoodFiles ( self)

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

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

◆ test_04_ModuleHandling()

python.TestCases.DQCTestCase.test_04_ModuleHandling ( self)

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

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

Member Data Documentation

◆ modlist

python.TestCases.DQCTestCase.modlist = []

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


The documentation for this class was generated from the following file: