def test_surface_area(r): sphere = Sphere(1) sphere.radius = r assert sphere.surface_area == 4 * np.pi * r**2
def test_volume(r): sphere = Sphere(1) sphere.radius = r assert sphere.volume == 4 / 3 * np.pi * r**3
def test_radius_getter_setter(r): sphere = Sphere(r) assert sphere.radius == r sphere.radius = r + 1 assert sphere.radius == r + 1