Refactor routing internals and archive retry benchmarks
This commit is contained in:
parent
a8720ac8c9
commit
ea5cfe7f31
1 changed files with 3481 additions and 2583 deletions
|
|
@ -4,7 +4,18 @@ from typing import Any
|
|||
from hypothesis import given, strategies as st
|
||||
import pytest
|
||||
|
||||
from inire.geometry.primitives import Port
|
||||
from inire.geometry.primitives import Port, port_local_coordinates, rotate_cardinal
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("heading", "expected"),
|
||||
[(0, (3.5, 7.25)), (90, (7.25, -3.5)), (180, (-3.5, -7.25)), (270, (-7.25, 3.5))],
|
||||
)
|
||||
def test_port_local_coordinates_preserve_fractional_points(heading, expected) -> None:
|
||||
origin = Port(10, -4, heading)
|
||||
local = port_local_coordinates(origin, 13.5, 3.25)
|
||||
assert local == expected
|
||||
assert rotate_cardinal(*local, heading) == (3.5, 7.25)
|
||||
|
||||
|
||||
@st.composite
|
||||
|
|
|
|||
Loading…
Reference in a new issue