Skip to content

Commit

Permalink
debugged unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashum68 committed Jun 4, 2024
1 parent 9bf0e4d commit d03d585
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/unit/test_flight_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
"""

import time
import pytest

from common.mavlink.modules import drone_odometry
from modules.common.mavlink.modules import drone_odometry
from modules.flight_interface import flight_interface


@pytest.fixture()
def create_flight_interface_instance(
address: str, timeout: float
) -> "tuple[bool, FlightInterface | None]":
Expand All @@ -18,10 +16,9 @@ def create_flight_interface_instance(
"""
result, flight_interface_instance = flight_interface.FlightInterface.create(address, timeout)

yield result, flight_interface_instance
return result, flight_interface_instance


@pytest.fixture()
def create_drone_position(
latitude: float, longitude: float, altitude: float
) -> drone_odometry.DronePosition:
Expand All @@ -33,7 +30,7 @@ def create_drone_position(
assert actual == expected
assert global_position is not None

yield global_position
return global_position


class TestFlightInterface:
Expand All @@ -52,7 +49,7 @@ def test_create_invalid_address(self) -> None:
"""
expected_result = False
expected_instance = None
actual_result, actual_instance = create_flight_interface_instance(None, self.TIMEOUT)
actual_result, actual_instance = create_flight_interface_instance("", self.TIMEOUT)
assert actual_result == expected_result
assert actual_instance == expected_instance

Expand Down

0 comments on commit d03d585

Please sign in to comment.