Blame SOURCES/use-config-not-gsettings-for-gui-test.patch

866890
diff -ru ibus-table-1.9.18.orig/tests/test_0_gtk.py ibus-table-1.9.18/tests/test_0_gtk.py
866890
--- ibus-table-1.9.18.orig/tests/test_0_gtk.py	2020-07-27 09:41:25.799087549 +0200
866890
+++ ibus-table-1.9.18/tests/test_0_gtk.py	2020-07-28 12:23:43.127130148 +0200
866890
@@ -68,6 +68,7 @@
866890
 
866890
 DONE_EXIT = True
866890
 ENGINE_NAME = 'wubi-jidian86'
866890
+CONFIG_SECTION = 'engine/table/%s' % ENGINE_NAME
866890
 
866890
 from gtkcases import TestCases
866890
 
866890
@@ -96,16 +97,18 @@
866890
 class SimpleGtkTestCase(unittest.TestCase):
866890
     global DONE_EXIT
866890
     global ENGINE_NAME
866890
+    global CONFIG_SECTION
866890
     ENGINE_PATH = '/com/redhat/IBus/engines/table/Test/Engine'
866890
 
866890
     @classmethod
866890
     def setUpClass(cls):
866890
         cls._flag = False
866890
         IBus.init()
866890
-        cls._gsettings = Gio.Settings(
866890
-            schema='org.freedesktop.ibus.engine.table',
866890
-            path='/org/freedesktop/ibus/engine/table/%s/' % ENGINE_NAME)
866890
-        cls._orig_chinesemode = cls._gsettings.get_int('chinesemode')
866890
+        cls.__bus = IBus.Bus()
866890
+        cls._config = cls.__bus.get_config()
866890
+        cls._orig_chinesemode = table.variant_to_value(
866890
+            cls._config.get_value(
866890
+                CONFIG_SECTION, 'chinesemode'))
866890
         signums = [getattr(signal, s, None) for s in
866890
                    'SIGINT SIGTERM SIGHUP'.split()]
866890
         for signum in filter(None, signums):
866890
@@ -116,7 +119,11 @@
866890
                                  (signum, original_handler))
866890
     @classmethod
866890
     def tearDownClass(cls):
866890
-        cls._gsettings.set_int('chinesemode', cls._orig_chinesemode)
866890
+        if cls._orig_chinesemode:
866890
+            cls._config.set_value(
866890
+                CONFIG_SECTION,
866890
+                'chinesemode',
866890
+                GLib.Variant.new_int32(cls._orig_chinesemode))
866890
 
866890
     @classmethod
866890
     def signal_handler(cls, user_data):
866890
@@ -136,10 +142,12 @@
866890
         self.__inserted_text = ''
866890
         self.__commit_done = False
866890
         self.__reset_coming = False
866890
-        self._gsettings.set_int('chinesemode', 4)
866890
+        self._config.set_value(
866890
+            CONFIG_SECTION,
866890
+            'chinesemode',
866890
+            GLib.Variant.new_int32(4))
866890
 
866890
     def register_ibus_engine(self):
866890
-        self.__bus = IBus.Bus()
866890
         if not self.__bus.is_connected():
866890
             self.fail('ibus-daemon is not running')
866890
             return False