Mercurial > hgrepos > Python > libs > ConfigMix
comparison tests/test.py @ 492:a9a291927a4b
FIX: Tests when calling getfirstNNNl() and friends properly
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Fri, 17 Dec 2021 17:38:17 +0100 |
| parents | 5a88c514d4e0 |
| children | 4f90e1eb7af8 |
comparison
equal
deleted
inserted
replaced
| 491:de776953337b | 492:a9a291927a4b |
|---|---|
| 592 def test27_getfirstvarl_nonexisting(self): | 592 def test27_getfirstvarl_nonexisting(self): |
| 593 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) | 593 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) |
| 594 self.assertRaises( | 594 self.assertRaises( |
| 595 KeyError, | 595 KeyError, |
| 596 cfg.getfirstvarl, | 596 cfg.getfirstvarl, |
| 597 [["db", "non", "existing", "key"], | 597 *[["db", "non", "existing", "key"], |
| 598 ("db", "non", "existing", "key2")]) | 598 ("db", "non", "existing", "key2")]) |
| 599 | 599 |
| 600 def test27b_getfirstvarl_nonexisting(self): | 600 def test27b_getfirstvarl_nonexisting(self): |
| 601 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) | 601 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) |
| 602 self.assertRaises( | 602 self.assertRaises( |
| 603 KeyError, | 603 KeyError, |
| 604 cfg.getfirstvarl, | 604 cfg.getfirstvarl, |
| 605 [{"namespace": None, "path": ["db", "non", "existing", "key"]}, | 605 *[{"namespace": None, "path": ["db", "non", "existing", "key"]}, |
| 606 {"namespace": None, "path": ["db", "non", "existing", "key2"]}]) | 606 {"namespace": None, "path": ["db", "non", "existing", "key2"]}]) |
| 607 | 607 |
| 608 def test28_getfirstvarl_nonexisting(self): | 608 def test28_getfirstvarl_nonexisting(self): |
| 609 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) | 609 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) |
| 610 self.assertIsNone(cfg.getfirstvarl( | 610 self.assertIsNone(cfg.getfirstvarl( |
| 611 [["db", "non", "existing", "key"], | 611 *[["db", "non", "existing", "key"], |
| 612 ("db", "non", "existing", "key2")], | 612 ("db", "non", "existing", "key2")], |
| 613 default=None)) | 613 default=None)) |
| 614 | 614 |
| 615 def test28b_getfirstvarl_nonexisting(self): | 615 def test28b_getfirstvarl_nonexisting(self): |
| 616 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) | 616 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) |
| 617 self.assertIsNone(cfg.getfirstvarl( | 617 self.assertIsNone(cfg.getfirstvarl( |
| 618 [{"namespace": None, "path": ["db", "non", "existing", "key"]}, | 618 *[{"namespace": None, "path": ["db", "non", "existing", "key"]}, |
| 619 {"namespace": None, "path": ("db", "non", "existing", "key2")}], | 619 {"namespace": None, "path": ("db", "non", "existing", "key2")}], |
| 620 default=None)) | 620 default=None)) |
| 621 | 621 |
| 622 def test29_getfirstvarl_existing(self): | 622 def test29_getfirstvarl_existing(self): |
| 623 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) | 623 cfg = self._load(os.path.join(TESTDATADIR, "conf20.yml")) |
| 624 self.assertEqual( | 624 self.assertEqual( |
