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)
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")
def func(): config = pokerengineconfig.Config([path.join(TESTS_PATH, '../conf')]) config.load('poker.holdem.xml')
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")
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")
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")