Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_landing_pad_tracking.py #176

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading