def testIntegerBaseHeight(self): base = 12 height = 15 result = triangle.triangle_area(base, height) expected = base * height * 0.5 self.assertEqual(result, expected, self.errorMessage)
def testNonZeroBaseZeroHeight(self): base = 15.123 height = 0 result = triangle.triangle_area(base, height) expected = base * height * 0.5 self.assertAlmostEqual(result, expected, places=7, msg=self.errorMessage, delta=0.0000001)
def testIntegerBaseFloatHeight(self): base = 12 height = 15.123 result = triangle.triangle_area(base, height) expected = base * height * 0.5 self.assertAlmostEqual(result, expected, places=7, msg=self.errorMessage, delta=0.0000001)