do not remove context user when reset config

This commit is contained in:
Emmanuel Garette 2018-09-29 22:21:25 +02:00
parent 509d902e72
commit 6e30f59803
2 changed files with 10 additions and 0 deletions

View File

@ -347,6 +347,8 @@ def test_help():
def test_config_reset():
descr = make_description()
c = Config(descr)
c.owner.set('test')
assert c.owner.get() == 'test'
assert not c.option('gc.gc2.bool').value.get()
assert not c.option('boolop').property.get()
assert not c.option('boolop').permissive.get()
@ -361,7 +363,9 @@ def test_config_reset():
assert c.option('float').permissive.get()
assert c.option('wantref').information.get('info', None)
#
assert c.owner.get() == 'test'
c.config.reset()
assert c.owner.get() == 'test'
assert not c.option('gc.gc2.bool').value.get()
assert not c.option('boolop').property.get()
assert not c.option('float').permissive.get()

View File

@ -1032,7 +1032,13 @@ class TiramisuContextConfig(TiramisuContext):
def _c_reset(self):
# Option's values
context_owner = self.config_bag.context.cfgimpl_get_values().get_context_owner()
self.config_bag.context.cfgimpl_get_values()._p_.importation((tuple(), tuple(), tuple(), tuple()))
self.config_bag.context.cfgimpl_get_values()._p_.setvalue(None,
None,
context_owner,
None,
True)
# Option's informations
self.config_bag.context.cfgimpl_get_values()._p_.del_informations()
# Option's properties