diff --git a/test/test_storage.py b/test/test_storage.py index 54eab0e..c4b5882 100644 --- a/test/test_storage.py +++ b/test/test_storage.py @@ -300,3 +300,31 @@ def test_two_different_information(): delete_session('test_persistent') delete_session('test_persistent2') + + +def test_exportation_importation(): + b = BoolOption('b', '') + o = OptionDescription('od', '', [b]) + try: + c = Config(o, session_id='test_persistent', persistent=True) + d = Config(o, session_id='test_persistent2', persistent=True) + except ValueError: + # storage is not persistent + pass + else: + assert c.option('b').value.get() is None + c.option('b').value.set(True) + assert c.option('b').value.get() is True + del c + # + c = Config(o, session_id='test_persistent', persistent=True) + assert c.value.exportation() == [['b'], [None], [True], ['user']] + d.value.importation(c.value.exportation()) + assert c.value.exportation() == [['b'], [None], [True], ['user']] + assert d.value.exportation() == [['b'], [None], [True], ['user']] + del d + # + d = Config(o, session_id='test_persistent2', persistent=True) + assert d.value.exportation() == [['b'], [None], [True], ['user']] + delete_session('test_persistent') + delete_session('test_persistent2')