From 5f79e3e0c250c4031d2993f5781dbc1b9cb1ea6f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 4 Mar 2026 14:00:35 -1000 Subject: [PATCH] [rp2040] Fix test assertions for Windows path separators Use str(Path(...)) in test assertions so paths match platform-specific separators (forward slashes on Unix, backslashes on Windows). --- tests/unit_tests/test_main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_main.py b/tests/unit_tests/test_main.py index e6ab5494e1a..115cdfe9d97 100644 --- a/tests/unit_tests/test_main.py +++ b/tests/unit_tests/test_main.py @@ -879,8 +879,9 @@ def test_choose_upload_log_host_no_defaults_with_rp2040_mass_storage( purpose=Purpose.UPLOADING, ) assert result == ["/dev/ttyUSB0"] # mock_choose_prompt default + vol_path = str(Path("/Volumes/RPI-RP2")) mock_choose_prompt.assert_called_once_with( - [("/Volumes/RPI-RP2 (RP2040 BOOTSEL)", "MS:/Volumes/RPI-RP2")], + [(f"{vol_path} (RP2040 BOOTSEL)", f"MS:{vol_path}")], purpose=Purpose.UPLOADING, ) @@ -983,10 +984,11 @@ def test_choose_upload_log_host_rp2040_serial_and_mass_storage( check_default=None, purpose=Purpose.UPLOADING, ) + vol_path = str(Path("/Volumes/RPI-RP2")) mock_choose_prompt.assert_called_once_with( [ ("/dev/ttyACM0 (RP2040 Serial)", "/dev/ttyACM0"), - ("/Volumes/RPI-RP2 (RP2040 BOOTSEL)", "MS:/Volumes/RPI-RP2"), + (f"{vol_path} (RP2040 BOOTSEL)", f"MS:{vol_path}"), ], purpose=Purpose.UPLOADING, )