comparison tests/test.py @ 659:b97e5f3bbc8e

Test indexed list access in variable interpolations: ok. Also drop an extra note into the documentation.
author Franz Glasner <f.glasner@feldmann-mg.com>
date Mon, 30 May 2022 14:08:40 +0200
parents 213f0ec3bbbc
children 9f0842a942b2
comparison
equal deleted inserted replaced
658:6102b767fc69 659:b97e5f3bbc8e
979 "index-access-for-jails.yml")) 979 "index-access-for-jails.yml"))
980 self.assertEqual( 980 self.assertEqual(
981 2, 981 2,
982 cfg.getvar_s(u"the-list.~%d~.entry" % (-1, ))) 982 cfg.getvar_s(u"the-list.~%d~.entry" % (-1, )))
983 983
984 def test53_expand_an_indexed_substitution(self):
985 cfg = self._load(os.path.join(TESTDATADIR,
986 "index-access-for-jails.yml"))
987 self.assertEqual(1, cfg.getvar_s(u"expand-me"))
988 self.assertEqual(2, cfg.getvar_s(u"expand-me-2"))
989
984 990
985 class T02LoadAndMerge(_T02MixinLoadAndMerge, unittest.TestCase): 991 class T02LoadAndMerge(_T02MixinLoadAndMerge, unittest.TestCase):
986 992
987 def setUp(self): 993 def setUp(self):
988 self._load = configmix.load 994 self._load = configmix.load