def testString(self): metric = Metric() metric.setName("bar") metric.setValue(100) metric.setSource("snafu") print(str(self)) self.assertEqual(str(metric), "bar 100 snafu", "String does not match")
def testAttributes(self): metric = Metric() metric.setName("foo") metric.setValue(10) metric.setSource("localhost") self.assertEqual(metric.getName(), "foo", "Name does not match") self.assertEqual(metric.getValue(), 10, "Values does nto match") self.assertEqual(metric.getSource(), "localhost", "Source does not match")