def testItems(self): c = Configuration("src/test/resources/test_param.json") c.load() config = c.getItems() self.assertEqual(len(config),2) self.assertEquals(config[0].getName(),"Echo foo") self.assertEquals(config[0].getPollInterval(),5) self.assertEquals(config[0].getCommand(),["echo","$HOME"]) self.assertEquals(config[1].getName(),"Echo bar") self.assertEquals(config[1].getPollInterval(),20) self.assertEquals(config[1].getCommand(),["echo","$PATH"])
def testEmptyItems(self): c = Configuration("src/test/resources/test_param.json") self.assertEquals(len(c.getItems()),0,"Items not equal to zero")