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