comparison tests/test.py @ 456:d6be95841380

Add a test for proper exception formatting when .rebind() raises a KeyError
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 15 Dec 2021 00:48:50 +0100
parents b95c12781497
children e3ae8092eaf3
comparison
equal deleted inserted replaced
455:27112bb4a5b9 456:d6be95841380
1277 jcfg.getvar_s(u"key4")) 1277 jcfg.getvar_s(u"key4"))
1278 1278
1279 def test_root_non_existing_raises(self): 1279 def test_root_non_existing_raises(self):
1280 cfg = configmix.load(os.path.join(TESTDATADIR, "conf10.py")) 1280 cfg = configmix.load(os.path.join(TESTDATADIR, "conf10.py"))
1281 self.assertRaises(KeyError, cfg.jailed, root=u"tree-non-existing") 1281 self.assertRaises(KeyError, cfg.jailed, root=u"tree-non-existing")
1282 self.assertRaises(
1283 KeyError, cfg.jailed, rootpath=(u"non", u"existing", u"tree"))
1282 1284
1283 def test_rootpath(self): 1285 def test_rootpath(self):
1284 cfg = configmix.load(os.path.join(TESTDATADIR, "conf10.py")) 1286 cfg = configmix.load(os.path.join(TESTDATADIR, "conf10.py"))
1285 jcfg = cfg.jailed(rootpath=[u"tree1"]) 1287 jcfg = cfg.jailed(rootpath=[u"tree1"])
1286 1288