def device_properties(self): """ A dictionary of device properties this testrun requires @rtype: C{dict} """ ret_val = {} if self._device is not None: if isinstance(self._device, dict): ret_val = self._device else: ret_val = string_2_dict(self._device) return ret_val
def _core_device_dict(self): """ rtype : C{dict} rparam : The `device` as taken from the core_options file """ ret_val = {} device = self.core_options_dict.get(DEVICE, None) if device is not None: if isinstance(device, str): ret_val = string_2_dict(device) elif isinstance(device, dict): ret_val = device else: raise ValueError("device has type '%s'"% type(device)) return ret_val
def test_string_2_dict(self): expected = {'veg': 'oranges', 'fruit': 'apples', 'meat': 'beef'} self.assertEquals(expected, string_2_dict("fruit:apples"\ " veg:oranges meat:beef"))