Beispiel #1
0
def test_lic2_epsilon_value_error(points, parameters):
    """
    Allowed values of EPSILON should be between 0 (inclusive) and PI (exclusive)
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    with pytest.raises(ValueError):
        lauch_conditions.lic_2(points)
Beispiel #2
0
def test_lic5_met(points, parameters):
    """
    LIC 5 should be met when there exists at least one set of two consecutive data
    points, (X[i],Y[i]) and (X[j],Y[j]), such that X[j] - X[i] < 0. (where i = j-1)
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_5(points) is True
Beispiel #3
0
def test_lic5_not_met(points, parameters):
    """
    LIC 5 should not be met when the x-coordinates of the points in the list increase
    monotonically
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_5(points) is False
Beispiel #4
0
def test_lic4_not_met(points, parameters):
    """
    LIC 4 should not be met when no set of Q_PTS consecutive points lie in more than
    QUADS quadrants
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_4(points) is False
Beispiel #5
0
def test_lic4_quads_value_error(points, parameters):
    """
    Allowed values of QUADS should be between 1 (inclusive) and 3 (inclusive)
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    with pytest.raises(ValueError):
        lauch_conditions.lic_4(points)
Beispiel #6
0
def test_lic4_met(points, parameters):
    """
    LIC 4 should be met when at least Q_PTS consecutive data points lie in more than
    QUADS quadrants
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_4(points) is True
Beispiel #7
0
def test_lic3_area1_value_error(points, parameters):
    """
    AREA1 should be greater or equal than 0
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    with pytest.raises(ValueError):
        lauch_conditions.lic_3(points)
Beispiel #8
0
def test_lic3_not_met(points, parameters):
    """
    LIC 3 should not be met when no set of three consecutive points are the vertices of a triangle
    with area greater than AREA1
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_3(points) is False
Beispiel #9
0
def test_lic6_not_met(points, parameters):
    """
    LIC 6 should not be met when no set of lie a distance greater than DIST from the
    line joining the first and last point, or when NUMPOINTS<3
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_6(points) is False
Beispiel #10
0
def test_lic2_met(points, parameters):
    """
    LIC 2 should be met when three consecutive points form an angle such that :
    angle < (PI − EPSILON) or angle > (PI + EPSILON)
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_2(points) is True
Beispiel #11
0
def test_lic2_undefined_angle(points, parameters):
    """
    LIC 2 should not be met when either the first or last point of the triplet coincide
    with the vertex
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_2(points) is False
Beispiel #12
0
def test_lic1_collinear_case(points, parameters, expected):
    """
    The results of the lic_1 function should be consistent also when three points
    are collinear
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_1(points) is expected
Beispiel #13
0
def test_lic1_not_met(points, parameters):
    """
    LIC 1 should not be met when all sets of three consecutive points can becontained
    within or on a circle of radius RADIUS1
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_1(points) is False
Beispiel #14
0
def test_lic6_dist_value_error(points, parameters):
    """
    DIST parameter shall be positive
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    with pytest.raises(ValueError):
        lauch_conditions.lic_6(points)
Beispiel #15
0
def test_lic6_met(points, parameters):
    """
    LIC 6 should be met when there exists N_PTS consecutive data points such that at
    least one of the points lies a distance greater than DIST from the line joining
    the first and last of these N_PTS points

    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.lic_6(points) is True
Beispiel #16
0
def test_lic6_n_pts_value_error(points, parameters):
    """
    Allowed values of N_PTS should be between 3 (inclusive) and NUMPOINTS (inclusive)
    But when N_PTS < 3 the function fails graciously (returns False) instead of raising
    an error
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    with pytest.raises(ValueError):
        lauch_conditions.lic_6(points)
Beispiel #17
0
def test_lic0_met():
    """LIC 0 should be met when two consecutive points are more than LENGTH1 apart"""
    lauch_conditions = decide.LaunchInterceptorConditions({"length1": 2})
    assert lauch_conditions.lic_0([[0, 0], [1, 1], [3, 3]]) is True
Beispiel #18
0
def test_populate_cmv(points, parameters, expected_cmv):
    """
    CMV should be correctly populated for a set of points given the parameters
    """
    lauch_conditions = decide.LaunchInterceptorConditions(parameters)
    assert lauch_conditions.get_conditions_met_vector(points) == expected_cmv