Пример #1
0
 def test_get_set_is_persistent_keystore(self):
     """Checks default persist value and set method."""
     # checks default
     assert Settings.is_persistent_keystore() is False
     # checks set
     Settings.set_is_persistent_keystore(True)
     assert Settings.is_persistent_keystore() is True
Пример #2
0
 def store_is_persistent_keystore(self):
     """
     Saves the persistency option to the store.
     Note that to save `True` we also check if we have write permissions.
     """
     persist_keystore = self.is_ui_persistent_keystore()
     persist_keystore = persist_keystore and check_write_permission()
     persistency_toggled = (Settings.is_persistent_keystore() !=
                            persist_keystore)
     if persistency_toggled:
         self.sync_keystore(persist_keystore)
     Settings.set_is_persistent_keystore(persist_keystore)