[gnome-settings-daemon/wip/carlosg/xsettings-test-fixes: 2/2] tests: Compare string array consistently



commit a66ab7cc0b912cb2423eb7946ee027e76dd141e7
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Nov 14 22:14:49 2018 +0100

    tests: Compare string array consistently
    
    The gtk modules xsetting may contain a ':' separated list of modules,
    where the order is meaningless. In order to avoid tripping with the
    unexpected order, split and sort it before doing our checks.

 plugins/xsettings/test.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/xsettings/test.py b/plugins/xsettings/test.py
index 2f203793..ae58bb78 100755
--- a/plugins/xsettings/test.py
+++ b/plugins/xsettings/test.py
@@ -153,8 +153,10 @@ class XsettingsPluginTest(gsdtestcase.GSDTestCase):
         time.sleep(1)
 
         # Check that both PK and canberra plugin are enabled
-        self.assertEqual(self.obj_xsettings_props.Get('org.gtk.Settings', 'Modules'),
-                dbus.String('pk-gtk-module:canberra-gtk-module', variant_level=1))
+        retval = self.obj_xsettings_props.Get('org.gtk.Settings', 'Modules')
+        values = sorted(str(retval).split(':'))
+        self.assertEqual(values[0], 'canberra-gtk-module')
+        self.assertEqual(values[1], 'pk-gtk-module')
 
     def test_enable_animations(self):
         # Check that "Enable animations" is off


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