2020-02-20 05:21:21 +00:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from core.location.mobility import WayPoint
|
|
|
|
|
2020-06-10 18:24:44 +01:00
|
|
|
POSITION = (0.0, 0.0, 0.0)
|
|
|
|
|
2020-02-20 05:21:21 +00:00
|
|
|
|
|
|
|
class TestMobility:
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"wp1, wp2, expected",
|
|
|
|
[
|
2020-06-10 18:24:44 +01:00
|
|
|
(WayPoint(10.0, 1, POSITION, 1.0), WayPoint(1.0, 2, POSITION, 1.0), False),
|
|
|
|
(WayPoint(1.0, 1, POSITION, 1.0), WayPoint(10.0, 2, POSITION, 1.0), True),
|
|
|
|
(WayPoint(1.0, 1, POSITION, 1.0), WayPoint(1.0, 2, POSITION, 1.0), True),
|
|
|
|
(WayPoint(1.0, 2, POSITION, 1.0), WayPoint(1.0, 1, POSITION, 1.0), False),
|
2020-02-20 05:21:21 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_waypoint_lessthan(self, wp1, wp2, expected):
|
|
|
|
assert (wp1 < wp2) == expected
|