All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cmdline_conf_test.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 import BaseTest
3 from BaseTest import *
4 
5 class Test(BaseTest):
6 
7  def __init__(self):
8  BaseTest.__init__(self)
9  self.name = os.path.basename(__file__)[:-5]
10  self.program="gaudirun.py"
11  self.args=["-v","-n","--option","MessageSvc().setFatal.append('AnotherAlg')"]
12  self.options="""
13 from Gaudi.Configuration import *
14 MessageSvc().setDebug.append("AnAlgorithm")"""
15 
16  def validator(self,stdout,stderr, result, causes, reference, error_reference):
17  conf_dict = eval('\n'.join(stdout.splitlines()))
18  expected = {'MessageSvc': {'setDebug': ['AnAlgorithm'], 'setFatal': ['AnotherAlg']}}
19 
20  if conf_dict != expected:
21  causes.append("configuration result")
22  from pprint import PrettyPrinter
23  pp = PrettyPrinter()
24  result["GaudiTest.configuration.expected"] = result.Quote(pp.pformat(expected))
25  result["GaudiTest.configuration.found"] = result.Quote(pp.pformat(conf_dict))