Skip to content

Commit 40d4425

Browse files
committed
refactor: helper: Fix WSL normalized_file_paths related tests.
Addressed issues with file path separators `\\` specific to WSL environments.
1 parent 440a3fa commit 40d4425

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tests/helper/test_helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ def test_process_media(
573573
)
574574
mocked_open_media = mocker.patch(MODULE + ".open_media")
575575
mocker.patch(MODULE + ".PLATFORM", platform)
576+
mocker.patch("zulipterminal.platform_code.PLATFORM", platform)
576577
mocker.patch("zulipterminal.core.Controller.show_media_confirmation_popup")
577578

578579
process_media(controller, link)

zulipterminal/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ def process_media(controller: Any, link: str) -> None:
784784
controller.view.set_footer_text, "Downloading your media..."
785785
)
786786
media_path = download_media(controller, link, show_download_status)
787+
media_path = normalized_file_path(media_path)
787788
tool = ""
788789

789790
# TODO: Add support for other platforms as well.
@@ -825,7 +826,7 @@ def download_media(
825826
show_download_status()
826827

827828
controller.report_success([" Downloaded ", ("bold", media_name)])
828-
return normalized_file_path(local_path)
829+
return local_path
829830

830831

831832
@asynch

0 commit comments

Comments
 (0)