comparison tests/test.py @ 628:c56971e85496

FIX: Arguments when calling .getvarl() and .getvarl_s()
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 14 Jan 2022 11:57:06 +0100
parents f167f8db4624
children 2426fa273a29
comparison
equal deleted inserted replaced
627:e3a23e9242a0 628:c56971e85496
467 467
468 def test15b_getvarl_with_original_default(self): 468 def test15b_getvarl_with_original_default(self):
469 # The default must be the original and not a copy 469 # The default must be the original and not a copy
470 dflt = {"foo2": "bar2"} 470 dflt = {"foo2": "bar2"}
471 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) 471 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml"))
472 self.assertTrue(cfg.getvarl((u"non", u"existing", u"key"), 472 self.assertTrue(cfg.getvarl(u"non", u"existing", u"key",
473 default=dflt) is dflt) 473 default=dflt) is dflt)
474 474
475 def test15c_getvarl_s_with_original_default(self): 475 def test15c_getvarl_s_with_original_default(self):
476 # The default must be the original and not a copy 476 # The default must be the original and not a copy
477 dflt = {"foo3": "bar3"} 477 dflt = {"foo3": "bar3"}
478 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) 478 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml"))
479 self.assertTrue(cfg.getvarl_s((u"non", u"existing", u"key4"), 479 self.assertTrue(cfg.getvarl_s(u"non", u"existing", u"key4",
480 default=dflt) is dflt) 480 default=dflt) is dflt)
481 481
482 def test16_getintvar_s_with_default(self): 482 def test16_getintvar_s_with_default(self):
483 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) 483 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml"))
484 self.assertEqual(9999, cfg.getintvar_s("non.existing.key", 484 self.assertEqual(9999, cfg.getintvar_s("non.existing.key",