From e6a183c00d89b60f928b02f0abb30f78c7ff56b2 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 24 Aug 2013 22:54:02 +0200 Subject: [PATCH] test get_modified_values --- test/test_config.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_config.py b/test/test_config.py index 0f7d7b3..5e96366 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -157,3 +157,19 @@ g3 = héhé g4 = True g5 = None""" config == '[od]' + + +def test_get_modified_values(): + g1 = IntOption('g1', '', 1) + g2 = StrOption('g2', '', 'héhé') + g3 = UnicodeOption('g3', '', u'héhé') + g4 = BoolOption('g4', '', True) + g5 = StrOption('g5', '') + d1 = OptionDescription('od', '', [g1, g2, g3, g4, g5]) + root = OptionDescription('root', '', [d1]) + config = Config(root) + assert config.cfgimpl_get_values().get_modified_values() == {} + config.od.g5 = 'yes' + assert config.cfgimpl_get_values().get_modified_values() == {'od.g5': ('user', 'yes')} + config.od.g4 = True + assert config.cfgimpl_get_values().get_modified_values() == {'od.g5': ('user', 'yes'), 'od.g4': ('user', True)}