test get_modified_values

This commit is contained in:
Emmanuel Garette 2013-08-24 22:54:02 +02:00
parent e4c129efc5
commit e6a183c00d

View File

@ -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)}