Beispiel #1
0
    def setUp(self):
        def callback(ctx, str):
            pass  #FIXME! if self.verbose >= 0: print "%s %s" % (ctx, str)

        libxml2.registerErrorHandler(callback, "-->")
        self.Config = pokerengineconfig.Config([
            PokerEngineConfigTestCase.TestConfDirectory,
            tempfile.gettempdir()
        ])

        self.ConfigTmplFile = path.join(
            PokerEngineConfigTestCase.TestConfDirectory,
            PokerEngineConfigTestCase.TestConfigTemplateFile)
        self.ConfigTempFile = path.join(
            tempfile.gettempdir(),
            PokerEngineConfigTestCase.TestConfigTemporaryFile)

        self.UpgradeTmplFile = path.join(
            PokerEngineConfigTestCase.TestUpgradeDirectory,
            PokerEngineConfigTestCase.TestUpgradeTemplateFile)
        self.UpgradeInvalidFile = path.join(
            PokerEngineConfigTestCase.TestUpgradeDirectory,
            PokerEngineConfigTestCase.TestUpgradeInvalidFile)

        if not self.CopyFile(self.ConfigTmplFile, self.ConfigTempFile):
            self.fail('Error during creation of configuration file ' +
                      self.ConfigTempFile)
Beispiel #2
0
 def test06_config_save(self):
     config = pokerengineconfig.Config([path.join(TESTS_PATH, '../conf')])
     config.load('poker.holdem.xml')
     config.path = "leaktmp"
     def func():
         config.save()
     self.leakWatch(func, "Config.save")
     os.unlink("leaktmp")
Beispiel #3
0
 def func():
     config = pokerengineconfig.Config([path.join(TESTS_PATH, '../conf')])
     config.load('poker.holdem.xml')
Beispiel #4
0
 def test08_config_headerGetProperties(self):
     config = pokerengineconfig.Config([path.join(TESTS_PATH, '../conf')])
     config.load('poker.holdem.xml')
     def func():
         config.headerGetProperties("/poker")
     self.leakWatch(func, "Config.headerGetProperties")
Beispiel #5
0
 def test07_config_headerGet(self):
     config = pokerengineconfig.Config([path.join(TESTS_PATH, '../conf')])
     config.load('poker.holdem.xml')
     def func():
         config.headerGet("/poker/@poker_engine_version")
     self.leakWatch(func, "Config.headerGet")
Beispiel #6
0
 def test05_config_reload(self):
     config = pokerengineconfig.Config([path.join(TESTS_PATH, '../conf')])
     config.load('poker.holdem.xml')
     def func():
         config.reload()
     self.leakWatch(func, "Config.reload")