def infoSetStatistics(self): stats = self.info("sets") stats = util.info_to_list(stats) stats.pop() stats = [util.info_colon_to_dict(stat) for stat in stats] sets = {} for stat in stats: ns_name = stat['ns_name'] set_name = stat['set_name'] key = (ns_name, set_name) if key not in sets: sets[key] = {} set_dict = sets[key] set_dict.update(stat) return sets
def testInfoColonToDict(self): value = "a=1:b=@:c=c:d=1@" expected = {'a': '1', 'b': '@', 'c': 'c', 'd': '1@'} result = util.info_colon_to_dict(value) self.assertEqual(result, expected)
def testInfoColonToDict(self): value = "a=1:b=@:c=c:d=1@" expected = {'a':'1', 'b':'@', 'c':'c', 'd':'1@'} result = util.info_colon_to_dict(value) self.assertEqual(result, expected)