test/test-mesh: Fix output of UpdateModelConfig method 45/228945/1
authorInga Stotland <inga.stotland@intel.com>
Tue, 25 Feb 2020 18:44:18 +0000 (10:44 -0800)
committerAnupam Roy <anupam.r@samsung.com>
Thu, 26 Mar 2020 10:34:51 +0000 (16:04 +0530)
This correctly unpacks configuration dictionary received
in the UpdateModelConfig() method

Change-Id: If7ca5d0b2249508bb0df4a0cc7f78d74da8e30bc
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
test/test-mesh

index 929e28f..6a5ddbd 100755 (executable)
@@ -554,7 +554,7 @@ class Element(dbus.service.Object):
        def set_model_config(self, configs):
                for config in configs:
                        mod_id = config[0]
-                       self.UpdateModelConfiguration(mod_id, config[1])
+                       self.update_model_config(mod_id, config[1])
 
        @dbus.service.method(MESH_ELEMENT_IFACE,
                                        in_signature="qqvay", out_signature="")
@@ -575,6 +575,11 @@ class Element(dbus.service.Object):
                                        in_signature="qa{sv}", out_signature="")
 
        def UpdateModelConfiguration(self, model_id, config):
+               cfg = unwrap(config)
+               print(cfg)
+               self.update_model_config(model_id, cfg)
+
+       def update_model_config(self, model_id, config):
                print(('Update Model Config '), end='')
                print(format(model_id, '04x'))
                for model in self.models:
@@ -644,11 +649,11 @@ class Model():
        def print_subscriptions(self, subscriptions):
                for sub in subscriptions:
                        if isinstance(sub, int):
-                               print('%04x' % sub, end=' ')
+                               print('%04x,' % sub, end=' ')
 
                        if isinstance(sub, list):
                                label = uuid.UUID(bytes=b''.join(sub))
-                               print(label, end=' ')
+                               print(label, ',', end=' ')
 
 ########################
 # On Off Server Model