fixed comparison logic for waypoints and added tests to help catch issue in the future
This commit is contained in:
parent
471f40a0bd
commit
8572e153f4
2 changed files with 21 additions and 4 deletions
17
daemon/tests/test_mobility.py
Normal file
17
daemon/tests/test_mobility.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import pytest
|
||||
|
||||
from core.location.mobility import WayPoint
|
||||
|
||||
|
||||
class TestMobility:
|
||||
@pytest.mark.parametrize(
|
||||
"wp1, wp2, expected",
|
||||
[
|
||||
(WayPoint(10.0, 1, [0, 0], 1.0), WayPoint(1.0, 2, [0, 0], 1.0), False),
|
||||
(WayPoint(1.0, 1, [0, 0], 1.0), WayPoint(10.0, 2, [0, 0], 1.0), True),
|
||||
(WayPoint(1.0, 1, [0, 0], 1.0), WayPoint(1.0, 2, [0, 0], 1.0), True),
|
||||
(WayPoint(1.0, 2, [0, 0], 1.0), WayPoint(1.0, 1, [0, 0], 1.0), False),
|
||||
],
|
||||
)
|
||||
def test_waypoint_lessthan(self, wp1, wp2, expected):
|
||||
assert (wp1 < wp2) == expected
|
Loading…
Add table
Add a link
Reference in a new issue