def test_circleArea(self): input1 = 1 output1 = math.pi self.assertEqual(output1, task.circleArea(input1)) input2 = 0 output2 = 0 self.assertEqual(output2, task.circleArea(input2))
def testCircle(self): pi = math.pi expected1 = pi expected2 = pi * 4 expected3 = pi * 9 expected0 = 0 self.assertEqual(expected1, task.circleArea(1)) self.assertEqual(expected2, task.circleArea(2)) self.assertEqual(expected3, task.circleArea(3)) self.assertEqual(expected0, task.circleArea(0))
def testCircleArea(self): expected = 0 self.assertEqual(expected, task.circleArea(0)) i = 0 while i < 10000: r = random.uniform(-10.0, 10.0) if r < 0: expected = None else: expected = math.pi * r**2 self.assertAlmostEqual(expected, task.circleArea(r), places=8) i = i + 1
def test2(self): radius = 2.5 expected = 19.625 self.assertEqual(expected, task.circleArea(radius))
def test1(self): radius = 3 expected = 28.26 self.assertEqual(expected, task.circleArea(radius))
def test4(self): expected = 4 self.assertNotEqual(expected, task.circleArea(4))
def test3(self): expected = 50.26548245743669 self.assertEqual(expected, task.circleArea(4))
def testCircleArea(self): expected = 28.27431 self.assertAlmostEqual(expected, task.circleArea(3), None, None, 0.01)
def test_circle_area(self): rad = 5 self.assertEqual(78.5, task.circleArea(rad)) rad = 7 self.assertEqual(153.86, task.circleArea(rad))
def testArea(self): expected = math.pi self.assertAlmostEqual(expected, task.circleArea(1))