comparison 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
comparison
equal deleted inserted replaced
761:72d317c255d4 762:3eb2c451026b
2633 self.assertEqual(u("new passphrase"), 2633 self.assertEqual(u("new passphrase"),
2634 nc.getvarl(u("user2"), u("pwd"))) 2634 nc.getvarl(u("user2"), u("pwd")))
2635 self.assertEqual(u("abcQQQ123456"), 2635 self.assertEqual(u("abcQQQ123456"),
2636 self._cfg.getvarl(u("globals"), u("user2"), u("pwd"))) 2636 self._cfg.getvarl(u("globals"), u("user2"), u("pwd")))
2637 2637
2638 def test_copy_new_config_complex_path(self):
2639 with self.assertRaises(ValueError):
2640 nc = self._cfg.copy_new_config_without("globals", "user1")
2641
2642 def test_copy_new_config_empty(self):
2643 nc = self._cfg.copy_new_config_without()
2644 nc.getvarl("globals")
2645 nc.getvarl("pool")
2646 nc.getvarl("section")
2647 nc.getvarl("parts")
2648
2649 def test_copy_new_config_unexisting_path(self):
2650 nc = self._cfg.copy_new_config_without("unexisting")
2651 nc.getvarl("globals")
2652 nc.getvarl("pool")
2653 nc.getvarl("section")
2654 nc.getvarl("parts")
2655
2656 def test_copy_new_config_existing(self):
2657 nc = self._cfg.copy_new_config_without("globals")
2658 with self.assertRaises(KeyError):
2659 nc.getvarl("globals")
2660 nc.getvarl("pool")
2661 nc.getvarl("section")
2662 nc.getvarl("parts")
2663
2638 2664
2639 if __name__ == "__main__": 2665 if __name__ == "__main__":
2640 unittest.main() 2666 unittest.main()