import numpy as np
from pytest import approx
from kokiy.axishell import AxiShell


def test_angle_min():
    ctrl_pts_x = (0.0, 0.2)
    ctrl_pts_r = (0.12, 0.12)
    n_azi, n_long = 8, 10
    angle = 40.0
    angle_min = 0.0
    axishell = AxiShell(
        n_azi, n_long, angle, ctrl_pts_x, ctrl_pts_r, angle_min=angle_min
    )

    print(
        "1 \n",
        axishell.theta,
        "2 \n",
        np.min(axishell.theta),
        "3 \n",
        np.rad2deg(np.min(axishell.theta)),
    )

    assert np.rad2deg(np.min(axishell.theta)) == approx(0.0)
    assert np.rad2deg(np.max(axishell.theta)) == approx(40.0)
