def load(self): self.json_data = open(self.path) self.data = json.load(self.json_data) # Loop over the items and put into list metricItems = self.data["items"] for i in metricItems: item = MetricItem() item.setName(str(i["name"])) item.setPollingInterval(int(i["pollInterval"])) item.setCommand(str(i["command"])) item.setDebug(bool(i["debug"])) self.config.append(item)
def testCommand(self): m = MetricItem() m.setCommand("snafu") self.assertEquals(m.getCommand(), "snafu", "Commands not equal")