Skip to content

Commit

Permalink
Update test_landing_pad_tracking.py (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
deltag0 authored Jun 26, 2024
1 parent b5cd1d4 commit 6d42c13
Showing 1 changed file with 48 additions and 13 deletions.
61 changes: 48 additions & 13 deletions tests/unit/test_landing_pad_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,15 @@ def test_is_similar_positive_equal_to_threshold(self) -> None:
Test case where the second landing pad has positive coordinates and the distance between
them is equal to the distance threshold.
"""
obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)[1]
obj_2 = object_in_world.ObjectInWorld.create(1, 1, 0)[1]
expected = False
result, obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)
assert result
assert obj_1 is not None

result, obj_2 = object_in_world.ObjectInWorld.create(1, 1, 0)
assert result
assert obj_2 is not None

expected = False
actual = landing_pad_tracking.LandingPadTracking._LandingPadTracking__is_similar( # type: ignore
obj_1,
obj_2,
Expand All @@ -140,8 +145,14 @@ def test_is_similar_negative_equal_to_threshold(self) -> None:
Test case where the second landing pad has negative coordinates and the distance between
them is equal to the distance threshold.
"""
obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)[1]
obj_2 = object_in_world.ObjectInWorld.create(-1, -1, 0)[1]
result, obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)
assert result
assert obj_1 is not None

result, obj_2 = object_in_world.ObjectInWorld.create(-1, -1, 0)
assert result
assert obj_2 is not None

expected = False

actual = landing_pad_tracking.LandingPadTracking._LandingPadTracking__is_similar( # type: ignore
Expand All @@ -157,8 +168,14 @@ def test_is_similar_positive_less_than_threshold(self) -> None:
Test case where the second landing pad has positive coordinates and the distance between
them is less than the distance threshold.
"""
obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)[1]
obj_2 = object_in_world.ObjectInWorld.create(0.5, 0.5, 0)[1]
result, obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)
assert result
assert obj_1 is not None

result, obj_2 = object_in_world.ObjectInWorld.create(0.5, 0.5, 0)
assert result
assert obj_2 is not None

expected = True

actual = landing_pad_tracking.LandingPadTracking._LandingPadTracking__is_similar( # type: ignore
Expand All @@ -174,8 +191,14 @@ def test_is_similar_negative_less_than_threshold(self) -> None:
Test case where the second landing pad has negative coordinates and the distance between
them is less than the distance threshold.
"""
obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)[1]
obj_2 = object_in_world.ObjectInWorld.create(-0.5, -0.5, 0)[1]
result, obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)
assert result
assert obj_1 is not None

result, obj_2 = object_in_world.ObjectInWorld.create(-0.5, -0.5, 0)
assert result
assert obj_2 is not None

expected = True

actual = landing_pad_tracking.LandingPadTracking._LandingPadTracking__is_similar( # type: ignore
Expand All @@ -191,8 +214,14 @@ def test_is_similar_positive_more_than_threshold(self) -> None:
Test case where the second landing pad has positive coordinates and the distance between
them is more than the distance threshold.
"""
obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)[1]
obj_2 = object_in_world.ObjectInWorld.create(2, 2, 0)[1]
result, obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)
assert result
assert obj_1 is not None

result, obj_2 = object_in_world.ObjectInWorld.create(2, 2, 0)
assert result
assert obj_2 is not None

expected = False

actual = landing_pad_tracking.LandingPadTracking._LandingPadTracking__is_similar( # type: ignore
Expand All @@ -208,8 +237,14 @@ def test_is_similar_negative_more_than_threshold(self) -> None:
Test case where the second landing pad has negative coordinates and the distance between
them is more than the distance threshold.
"""
obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)[1]
obj_2 = object_in_world.ObjectInWorld.create(-2, -2, 0)[1]
result, obj_1 = object_in_world.ObjectInWorld.create(0, 0, 0)
assert result
assert obj_1 is not None

result, obj_2 = object_in_world.ObjectInWorld.create(-2, -2, 0)
assert result
assert obj_2 is not None

expected = False

actual = landing_pad_tracking.LandingPadTracking._LandingPadTracking__is_similar( # type: ignore
Expand Down

0 comments on commit 6d42c13

Please sign in to comment.