impl_get_information and impl_set_information are, now, persistent in storage
This commit is contained in:
@ -141,6 +141,7 @@ def test_information_config():
|
||||
string = 'some informations'
|
||||
config.impl_set_information('info', string)
|
||||
assert config.impl_get_information('info') == string
|
||||
raises(ValueError, "config.impl_get_information('noinfo')")
|
||||
|
||||
|
||||
def test_config_impl_get_path_by_opt():
|
||||
|
@ -18,7 +18,6 @@ def test_list():
|
||||
b = BoolOption('b', '')
|
||||
o = OptionDescription('od', '', [b])
|
||||
c = Config(o, session_id='test_non_persistent')
|
||||
from tiramisu.setting import list_sessions
|
||||
assert 'test_non_persistent' in list_sessions()
|
||||
del(c)
|
||||
assert 'test_non_persistent' not in list_sessions()
|
||||
@ -43,7 +42,6 @@ def test_list_sessions_persistent():
|
||||
# storage is not persistent
|
||||
pass
|
||||
else:
|
||||
from tiramisu.setting import list_sessions
|
||||
assert 'test_persistent' in list_sessions()
|
||||
|
||||
|
||||
@ -124,3 +122,19 @@ def test_two_persistent_owner():
|
||||
assert c.getowner(b) == owners.persistent
|
||||
assert c2.getowner(b) == owners.persistent
|
||||
delete_session('test_persistent')
|
||||
|
||||
|
||||
def test_two_persistent_information():
|
||||
b = BoolOption('b', '')
|
||||
o = OptionDescription('od', '', [b])
|
||||
try:
|
||||
c = Config(o, session_id='test_persistent', persistent=True)
|
||||
except ValueError:
|
||||
# storage is not persistent
|
||||
pass
|
||||
else:
|
||||
c.impl_set_information('info', 'string')
|
||||
assert c.impl_get_information('info') == 'string'
|
||||
c2 = Config(o, session_id='test_persistent', persistent=True)
|
||||
assert c2.impl_get_information('info') == 'string'
|
||||
delete_session('test_persistent')
|
||||
|
Reference in New Issue
Block a user