[orca/new-settings] Created new test for exercise new Settings Manager.
- From: Alejandro Leiva <aleiva src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/new-settings] Created new test for exercise new Settings Manager.
- Date: Tue, 26 Oct 2010 14:46:47 +0000 (UTC)
commit e02066d6be1abd2079ff9c12f673c5c5edc248bd
Author: Alejandro Leiva <aleiva emergya es>
Date: Tue Oct 26 16:46:15 2010 +0200
Created new test for exercise new Settings Manager.
src/orca/settings_manager.py | 8 ++++----
test/harness/settings_test.py | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/settings_manager.py b/src/orca/settings_manager.py
index 3643efa..1450ab0 100644
--- a/src/orca/settings_manager.py
+++ b/src/orca/settings_manager.py
@@ -27,7 +27,7 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2010 Consorcio Fernando de los Rios."
__license__ = "LGPL"
-from orca import settings
+import settings
import os
class SettingsManager():
@@ -262,9 +262,9 @@ class SettingsManager():
self._mergeSettings()
def getPreferences(self, profile='default'):
- general = getGeneral(profile)
- pronunciations = getPronunciations(profile)
- keybindings = getKeybindings(profile)
+ general = self.getGeneralSettings(profile)
+ pronunciations = self.getPronunciations(profile)
+ keybindings = self.getKeybindings(profile)
return (general, pronunciations, keybindings)
def getGeneralSettings(self, profile='default'):
diff --git a/test/harness/settings_test.py b/test/harness/settings_test.py
new file mode 100644
index 0000000..05de800
--- /dev/null
+++ b/test/harness/settings_test.py
@@ -0,0 +1,39 @@
+from orca.settings_manager import SettingsManager
+
+def exerciseBackendAPI(profile, backendName, settingsManager):
+ settingsManager.backendName = backendName
+ settingsManager._loadBackend()
+
+ print 'Profiles list', profile, settingsManager.availableProfiles()
+
+ #settingsManager.setProfile(profile)
+
+ # Getters
+ preferences = settingsManager.getPreferences(profile)
+ print 'preferences: \n',preferences,'\n\n'
+
+ generalSettings = settingsManager.getGeneralSettings(profile)
+ print 'generalSettings: \n',generalSettings,'\n\n'
+
+ pronunciations = settingsManager.getPronunciations(profile)
+ print 'pronunciations: \n',pronunciations,'\n\n'
+
+ keybindings = settingsManager.getKeybindings(profile)
+ print 'keybindings: \n',keybindings,'\n\n'
+
+ # Other stuff
+ #settingsManager.saveSettings()
+ isClassic = settingsManager.isClassic()
+ sFirstStart = settingsManager.isFirstStart()
+ #settingsManager.setFirstStart()
+
+
+# main
+profile = 'default'
+s = SettingsManager()
+print s
+print 'profile: default backendName: yaml\n'
+exerciseBackendAPI('default', 'yaml', s)
+print 'profile: default backendName: gconf\n'
+exerciseBackendAPI('default', 'gconf', s)
+#exerciseBackendAPI('default', 'gsettings', s)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]