Esempio n. 1
0
def test_vector4_normalize():
    vec = (5, 2.5, 5, 10)
    result = (0.4, 0.2, 0.4, 0.8)
    to_check = utilities.vector_normalize(vec)
    assert to_check == result
Esempio n. 2
0
def test_vector_normalize3():
    with pytest.raises(TypeError):
        utilities.vector_normalize(5)
Esempio n. 3
0
def test_vector3_normalize():
    vec = (5, 2.5, 5)
    result = (0.667, 0.333, 0.667)
    to_check = utilities.vector_normalize(vec, decimals=3)
    assert to_check == result
Esempio n. 4
0
def test_vector_normalize2():
    with pytest.raises(ValueError):
        vec = (0, 0)
        utilities.vector_normalize(vec)