Add faulty circle_area function and tests

This commit is contained in:
2021-11-04 19:52:28 +01:00
parent 71e3ebf161
commit 918f294df9
3 changed files with 27 additions and 0 deletions

0
tests/__init__.py Normal file
View File

15
tests/test_circle_area.py Normal file
View 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)