test get_modified_values
This commit is contained in:
parent
e4c129efc5
commit
e6a183c00d
1 changed files with 16 additions and 0 deletions
|
@ -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)}
|
||||
|
|
Loading…
Reference in a new issue