def test_removePreference(preference): preferences = Preferences() preferences.addPreference(preference["key"], preference["default"]) preferences.removePreference(preference["key"]) assert preferences.getValue(preference["key"]) is None
def test_nonExistingSetting(): preferences = Preferences() # Test that attempting to modify a non existing setting in any way doesn't break things. preferences.setDefault("nonExistingPreference", "whatever") preferences.setValue("nonExistingPreference", "whatever") preferences.removePreference("nonExistingPreference")