예제 #1
0
def test_radius_getter_setter(square_points, r):
    """Test getting and setting the radius."""
    square_points = square_points[:, :2]
    convexspheropolygon = ConvexSpheropolygon(square_points, r)
    assert convexspheropolygon.radius == r
    convexspheropolygon.radius = r + 1
    assert convexspheropolygon.radius == r + 1
예제 #2
0
def test_invalid_radius_setter(square_points, r):
    """Test setting invalid radius values."""
    square_points = square_points[:, :2]
    spheropolygon = ConvexSpheropolygon(square_points, 1)
    with pytest.raises(ValueError):
        spheropolygon.radius = r
예제 #3
0
 def testfun(r):
     square_points_2d = square_points[:, :2]
     spheropolygon = ConvexSpheropolygon(square_points_2d, 1)
     with pytest.raises(ValueError):
         spheropolygon.radius = r
예제 #4
0
 def testfun(r):
     square_points_2d = square_points[:, :2]
     convexspheropolygon = ConvexSpheropolygon(square_points_2d, r)
     assert convexspheropolygon.radius == r
     convexspheropolygon.radius = r + 1
     assert convexspheropolygon.radius == r + 1