From dfdbb4d927cd6b03025af15b4091bf020c0444cf Mon Sep 17 00:00:00 2001 From: RexBerry <59031902+RexBerry@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:38:18 -0600 Subject: [PATCH] Use golf_data.json in unit tests #23 --- flight/test_files/airdrop_unit_test.py | 2 +- flight/test_files/hoffman_waypoint_test.py | 2 +- flight/test_files/odlc_state_test.py | 4 +++- flight/test_files/waypoint_state_test.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/flight/test_files/airdrop_unit_test.py b/flight/test_files/airdrop_unit_test.py index c3558e5e..b7853a79 100644 --- a/flight/test_files/airdrop_unit_test.py +++ b/flight/test_files/airdrop_unit_test.py @@ -48,7 +48,7 @@ async def run() -> None: # wait for drone to take off await asyncio.sleep(10) - flight_settings: FlightSettings = FlightSettings() + flight_settings: FlightSettings = FlightSettings(path_data_path="flight/data/golf_data.json") logging.info("starting airdrop") diff --git a/flight/test_files/hoffman_waypoint_test.py b/flight/test_files/hoffman_waypoint_test.py index 8bcaf60a..0d083cf9 100644 --- a/flight/test_files/hoffman_waypoint_test.py +++ b/flight/test_files/hoffman_waypoint_test.py @@ -13,7 +13,7 @@ from state_machine.drone import Drone # Defining file path constant for extract_gps -MOVE_TO_TEST_PATH: str = "./data/waypoint_data.json" +MOVE_TO_TEST_PATH: str = "flight/data/golf_data.json" # Defining altitude and speed MOVE_TO_TEST_ALTITUDE: int = 12 diff --git a/flight/test_files/odlc_state_test.py b/flight/test_files/odlc_state_test.py index e13d45ce..8d17116a 100644 --- a/flight/test_files/odlc_state_test.py +++ b/flight/test_files/odlc_state_test.py @@ -27,7 +27,9 @@ async def run_test(_sim: bool, odlc_count: int = 5) -> None: drone.use_sim_settings() else: drone.use_real_settings() - flight_settings: FlightSettings = FlightSettings(sim_flag=_sim, skip_waypoint=True) + flight_settings: FlightSettings = FlightSettings( + sim_flag=_sim, skip_waypoint=True, path_data_path="flight/data/golf_data.json" + ) await drone.connect_drone() state_task: asyncio.Task[None] = asyncio.ensure_future( StateMachine(Start(drone, flight_settings), drone, flight_settings).run() diff --git a/flight/test_files/waypoint_state_test.py b/flight/test_files/waypoint_state_test.py index 54539d97..29d41325 100644 --- a/flight/test_files/waypoint_state_test.py +++ b/flight/test_files/waypoint_state_test.py @@ -179,7 +179,7 @@ async def run_test(_sim: bool) -> None: # Temporary fix for unused variable # Output logging info to stdout logging.basicConfig(filename="/dev/stdout", level=logging.INFO) - path_data_path: str = "flight/data/waypoint_data.json" if _sim else "flight/data/golf_data.json" + path_data_path: str = "flight/data/golf_data.json" drone: Drone = Drone() if _sim: