Exemplo n.º 1
0
def test_normalize_knot_vector3():
    with pytest.raises(TypeError):
        knotvector.normalize(5)
Exemplo n.º 2
0
def test_normalize_knot_vector2():
    input_kv = (-5, -5, -3, -2, 2, 3, 5, 5)
    output_kv = [0.0, 0.0, 0.2, 0.3, 0.7, 0.8, 1.0, 1.0]
    to_check = knotvector.normalize(input_kv)
    assert to_check == output_kv
Exemplo n.º 3
0
def test_normalize_knot_vector1():
    # check for empty list/tuple
    with pytest.raises(ValueError):
        knotvector.normalize(tuple())
Exemplo n.º 4
0
def test_normalize_knot_vector2():
    input_kv = (-5, -5, -3, -2, 2, 3, 5, 5)
    output_kv = [0.0, 0.0, 0.2, 0.3, 0.7, 0.8, 1.0, 1.0]
    to_check = knotvector.normalize(input_kv)
    assert to_check == output_kv
Exemplo n.º 5
0
def test_normalize_knot_vector1():
    # check for empty list/tuple
    with pytest.raises(ValueError):
        knotvector.normalize(tuple())
Exemplo n.º 6
0
def test_normalize_knot_vector3():
    with pytest.raises(TypeError):
        knotvector.normalize(5)