Fix test code style.

This commit is contained in:
Sergey Vartanov 2021-05-04 03:52:51 +03:00
parent f0c8ee6de1
commit b26c4d3e46

View file

@ -8,28 +8,27 @@ import numpy as np
from roentgen.direction import parse_vector from roentgen.direction import parse_vector
def test_compass_points_1(): def test_compass_points_1() -> None:
""" Test north direction. """ """ Test north direction. """
assert np.allclose(parse_vector("N"), np.array([0, -1])) assert np.allclose(parse_vector("N"), np.array([0, -1]))
def test_compass_points_2(): def test_compass_points_2() -> None:
""" Test north-west direction. """ """ Test north-west direction. """
root: np.float64 = -np.sqrt(2) / 2 root: np.float64 = -np.sqrt(2) / 2
assert np.allclose(parse_vector("NW"), np.array([root, root])) assert np.allclose(parse_vector("NW"), np.array([root, root]))
def test_compass_points_3(): def test_compass_points_3() -> None:
""" Test south-south-west direction. """ """ Test south-south-west direction. """
assert np.allclose( assert np.allclose(parse_vector("SSW"), np.array([-0.38268343, 0.92387953]))
parse_vector("SSW"), np.array([-0.38268343, 0.92387953]))
def test_invalid(): def test_invalid() -> None:
""" Test invalid direction representation string. """ """ Test invalid direction representation string. """
assert not parse_vector("O") assert not parse_vector("O")
def test_degree(): def test_degree() -> None:
""" Test east direction. """ """ Test east direction. """
assert np.allclose(parse_vector("90"), np.array([1, 0])) assert np.allclose(parse_vector("90"), np.array([1, 0]))