test/test-mesh: Initialize required properties
authorInga Stotland <inga.stotland@intel.com>
Thu, 25 Jul 2019 18:31:45 +0000 (11:31 -0700)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 17 Dec 2019 16:23:50 +0000 (21:53 +0530)
This initialized required "Models" and "VendorModels" properties
wheher the actual models exist or not, according to the mesh-api.txt.
In case when an element does not contain either SIG defined models or
vendor defineed models, the corresponding properties should contain
empty arrays.

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

index 6e91963..3c5ded7 100755 (executable)
@@ -537,10 +537,8 @@ class Element(dbus.service.Object):
                sig_models = self._get_sig_models()
 
                props = {'Index' : dbus.Byte(self.index)}
-               if len(sig_models) != 0:
-                       props['Models'] = dbus.Array(sig_models, signature='q')
-               if len(vendor_models) != 0:
-                       props['VendorModels'] = dbus.Array(vendor_models,
+               props['Models'] = dbus.Array(sig_models, signature='q')
+               props['VendorModels'] = dbus.Array(vendor_models,
                                                        signature='(qq)')
                #print(props)
                return { MESH_ELEMENT_IFACE: props }