File size: 470 Bytes
275b9f3
 
 
 
b1ce64c
275b9f3
b1ce64c
275b9f3
b1ce64c
275b9f3
 
b1ce64c
275b9f3
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from unittest import TestCase
from src.shapes import Circle, Rectangle

class TestShapes(TestCase):
    """Test shapes"""
    def test_circle_area(self):
        """Test circle area calculation"""
        circle = Circle(radius=5)
        self.assertAlmostEqual(circle.area(), 78.5, places=1)

    def test_rectangle_area(self):
        """Test rectangle area calculation"""
        rectangle = Rectangle(width=4, height=5)
        self.assertEqual(rectangle.area(), 20)