Add faulty circle_area function and tests
This commit is contained in:
15
tests/test_circle_area.py
Normal file
15
tests/test_circle_area.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from unittest import TestCase
|
||||
import math
|
||||
|
||||
from drone_test import circle_area
|
||||
|
||||
class CircleAreaTest(TestCase):
|
||||
def test_area_1(self):
|
||||
self.assertEqual(circle_area(1), math.pi)
|
||||
|
||||
def test_area_2(self):
|
||||
self.assertEqual(circle_area(2), math.pi * 4)
|
||||
|
||||
def test_negative(self):
|
||||
with self.assertRaises(ValueError):
|
||||
circle_area(-1)
|
||||
Reference in New Issue
Block a user