From 06f501ad055a0e050e9c07d2b948abae7679711b Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 5 Apr 2019 21:17:36 +0200 Subject: [PATCH] test for property in persistent storage --- test/test_storage.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/test_storage.py b/test/test_storage.py index 9e36af2..eac36d4 100644 --- a/test/test_storage.py +++ b/test/test_storage.py @@ -307,3 +307,31 @@ def test_exportation_importation(): delete_session('test_persistent') delete_session('test_persistent2') delete_session('test_persistent3') + + +def test_create_persistent_context_property(): + b = BoolOption('b', '') + o = OptionDescription('od', '', [b]) + if default_storage.is_persistent(): + c = Config(o, session_id='test_persistent', persistent=True) + c.property.add('persistent') + del c + # + c = Config(o, session_id='test_persistent', persistent=True) + assert 'persistent' in c.property.get() + del c + delete_session('test_persistent') + + +def test_create_persistent_property(): + b = BoolOption('b', '') + o = OptionDescription('od', '', [b]) + if default_storage.is_persistent(): + c = Config(o, session_id='test_persistent', persistent=True) + c.option('b').property.add('persistent') + del c + # + c = Config(o, session_id='test_persistent', persistent=True) + assert 'persistent' in c.option('b').property.get() + del c + delete_session('test_persistent')