[d-feet] Fix markup string handling for tuple



commit a74c855cfd679679d8a3e7795a69802981226d44
Author: Thomas Bechtold <thomasbechtold jpberlin de>
Date:   Wed Jun 19 08:13:44 2013 +0200

    Fix markup string handling for tuple
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702593

 src/dfeet/introspection_helper.py |    2 +-
 src/tests/tests.py                |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/dfeet/introspection_helper.py b/src/dfeet/introspection_helper.py
index 20d4506..348b772 100644
--- a/src/dfeet/introspection_helper.py
+++ b/src/dfeet/introspection_helper.py
@@ -87,7 +87,7 @@ class DBusProperty(DBusInterface):
             args_signature_markup(sig),
             args_name_markup(self.property_info.name), " / ".join(readwrite))
         if self.value:
-            s += " = %s" % (self.value)
+            s += " = %s" % (self.value,)
         return s
 
     @property
diff --git a/src/tests/tests.py b/src/tests/tests.py
index 19d2f09..0a6de47 100755
--- a/src/tests/tests.py
+++ b/src/tests/tests.py
@@ -23,6 +23,7 @@ XML = """
     </method>
     <property name="TestString" type="s" access="readwrite"/>
     <property name="TestBool" type="b" access="read"/>
+    <property name="TestStruct" type="(suu)" access="read"/>
     <signal name="TestSignal">
       <arg name="SigString" type="s"/>
       <arg name="SigBool" type="b"/>
@@ -55,7 +56,7 @@ class IntrospectionHelperTest(unittest.TestCase):
         self.assertEqual(obj_iface.name, self.name)
         self.assertEqual(obj_iface.object_path, self.object_path)
         self.assertEqual(len(obj_iface.iface_info.methods), 1)
-        self.assertEqual(len(obj_iface.iface_info.properties), 2)
+        self.assertEqual(len(obj_iface.iface_info.properties), 3)
         self.assertEqual(len(obj_iface.iface_info.signals), 1)
 
     def test_dbus_property(self):
@@ -65,6 +66,10 @@ class IntrospectionHelperTest(unittest.TestCase):
         obj_prop = DBusProperty(obj_iface, obj_iface.iface_info.properties[0])
         self.assertEqual(obj_prop.name, self.name)
         self.assertEqual(obj_prop.object_path, self.object_path)
+        #get the markup string with value for struct prop (see bgo #702593)
+        obj_prop = DBusProperty(obj_iface, obj_iface.iface_info.properties[2])
+        obj_prop.value = ("string", 1, 2)
+        self.assertIn("'string', 1, 2", obj_prop.markup_str)
 
     def test_dbus_signal(self):
         """test DBusSignal class"""


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