mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-23 22:16:25 +02:00
Fix code style.
This commit is contained in:
parent
c9fe5e55b6
commit
2667ee9d02
16 changed files with 228 additions and 240 deletions
|
@ -9,22 +9,27 @@ from roentgen.direction import parse_vector
|
|||
|
||||
|
||||
def test_compass_points_1():
|
||||
""" Test north direction. """
|
||||
assert np.allclose(parse_vector("N"), np.array([0, -1]))
|
||||
|
||||
|
||||
def test_compass_points_2():
|
||||
""" Test north-west direction. """
|
||||
root: np.float64 = -np.sqrt(2) / 2
|
||||
assert np.allclose(parse_vector("NW"), np.array([root, root]))
|
||||
|
||||
|
||||
def test_compass_points_3():
|
||||
""" Test south-south-west direction. """
|
||||
assert np.allclose(
|
||||
parse_vector("SSW"), np.array([-0.38268343, 0.92387953]))
|
||||
|
||||
|
||||
def test_wrong():
|
||||
def test_invalid():
|
||||
""" Test invalid direction representation string. """
|
||||
assert not parse_vector("O")
|
||||
|
||||
|
||||
def test_degree():
|
||||
""" Test east direction. """
|
||||
assert np.allclose(parse_vector("90"), np.array([1, 0]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue