Mercurial > hgrepos > Python > libs > ConfigMix
diff tests/test.py @ 762:3eb2c451026b
Implement Configuration.copy_new_config_without()
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 07 Dec 2023 08:43:04 +0100 |
| parents | cabd1046d95f |
| children |
line wrap: on
line diff
--- a/tests/test.py Thu Dec 07 08:42:33 2023 +0100 +++ b/tests/test.py Thu Dec 07 08:43:04 2023 +0100 @@ -2635,6 +2635,32 @@ self.assertEqual(u("abcQQQ123456"), self._cfg.getvarl(u("globals"), u("user2"), u("pwd"))) + def test_copy_new_config_complex_path(self): + with self.assertRaises(ValueError): + nc = self._cfg.copy_new_config_without("globals", "user1") + + def test_copy_new_config_empty(self): + nc = self._cfg.copy_new_config_without() + nc.getvarl("globals") + nc.getvarl("pool") + nc.getvarl("section") + nc.getvarl("parts") + + def test_copy_new_config_unexisting_path(self): + nc = self._cfg.copy_new_config_without("unexisting") + nc.getvarl("globals") + nc.getvarl("pool") + nc.getvarl("section") + nc.getvarl("parts") + + def test_copy_new_config_existing(self): + nc = self._cfg.copy_new_config_without("globals") + with self.assertRaises(KeyError): + nc.getvarl("globals") + nc.getvarl("pool") + nc.getvarl("section") + nc.getvarl("parts") + if __name__ == "__main__": unittest.main()
