[tracker/sam/functional-test-fixes: 8/20] fixup! functional-tests: Convert DConf code to use GObject introspection



commit 5dec9a8f37df225584e4bd90cae4bb34038791f8
Author: Sam Thursfield <sam afuera me uk>
Date:   Sun Jul 20 12:25:53 2014 +0100

    fixup! functional-tests: Convert DConf code to use GObject introspection

 .../functional-tests/301-miner-resource-removal.py |    4 ++--
 tests/functional-tests/common/utils/dconf.py       |    4 ++--
 tests/functional-tests/common/utils/minertest.py   |    2 +-
 tests/functional-tests/common/utils/system.py      |    8 ++++++--
 4 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/tests/functional-tests/301-miner-resource-removal.py 
b/tests/functional-tests/301-miner-resource-removal.py
index f1a8a38..c50cb6d 100755
--- a/tests/functional-tests/301-miner-resource-removal.py
+++ b/tests/functional-tests/301-miner-resource-removal.py
@@ -48,10 +48,10 @@ CONF_OPTIONS = {
     cfg.DCONF_MINER_SCHEMA: {
         'enable-writeback': GLib.Variant.new_boolean(False),
         'index-recursive-directories': GLib.Variant.new_strv([MINER_TMP_DIR]),
-        'index-single-directories': GLib.Variant.new_strv([])),
+        'index-single-directories': GLib.Variant.new_strv([]),
         'index-optical-discs': GLib.Variant.new_boolean(False),
         'index-removable-devices': GLib.Variant.new_boolean(False),
-        'throttle': GLib.Variant.new_int(5)),
+        'throttle': GLib.Variant.new_int32(5),
     }
 }
 
diff --git a/tests/functional-tests/common/utils/dconf.py b/tests/functional-tests/common/utils/dconf.py
index 11a7851..0af94ce 100644
--- a/tests/functional-tests/common/utils/dconf.py
+++ b/tests/functional-tests/common/utils/dconf.py
@@ -23,12 +23,12 @@ class DConfClient(object):
     def __init__ (self, schema):
         self._settings = Gio.Settings.new(schema)
 
-        backend = self.settings.get_property('backend')
+        backend = self._settings.get_property('backend')
         self._check_settings_backend_is_dconf(backend)
         self._check_using_correct_dconf_profile()
 
     def _check_settings_backend_is_dconf(self, backend):
-        typename = type(backend).__name__
+        typename = type(backend).__name__.split('.')[-1]
         if typename != 'DConfSettingsBackend':
             raise Exception(
                 "The functional tests require DConf to be the default "
diff --git a/tests/functional-tests/common/utils/minertest.py 
b/tests/functional-tests/common/utils/minertest.py
index 46ee2d7..7111d86 100644
--- a/tests/functional-tests/common/utils/minertest.py
+++ b/tests/functional-tests/common/utils/minertest.py
@@ -45,7 +45,7 @@ CONF_OPTIONS = {
         'index-single-directories': GLib.Variant.new_strv([]),
         'index-optical-discs': GLib.Variant.new_boolean(False),
         'index-removable-devices': GLib.Variant.new_boolean(False),
-        'throttle': GLib.Variant.new_int(5),
+        'throttle': GLib.Variant.new_int32(5),
     }
 }
 
diff --git a/tests/functional-tests/common/utils/system.py b/tests/functional-tests/common/utils/system.py
index a3ca69a..1cc2b98 100644
--- a/tests/functional-tests/common/utils/system.py
+++ b/tests/functional-tests/common/utils/system.py
@@ -66,14 +66,18 @@ class TrackerSystemAbstraction:
             os.environ [var] = value
 
         # Previous loop should have set DCONF_PROFILE to the test location
+        if settings is not None:
+            self._apply_settings(settings)
+
+        helpers.log ("[Conf] environment ready")
+
+    def _apply_settings(self, settings):
         for schema_name, contents in settings.iteritems():
             dconf = DConfClient(schema_name)
             dconf.reset()
             for key, value in contents.iteritems():
                 dconf.write(key, value)
 
-        helpers.log ("[Conf] environment ready")
-
     def unset_up_environment (self):
         """
         Unset the XDG_*_HOME variables from the environment


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]