Skip to content

Commit

Permalink
refactor: helper: Fix WSL normalized_file_paths related tests.
Browse files Browse the repository at this point in the history
Addressed issues with file path separators `\\` specific to WSL
environments.
  • Loading branch information
rsashank committed Jun 27, 2024
1 parent 440a3fa commit 40d4425
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/helper/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ def test_process_media(
)
mocked_open_media = mocker.patch(MODULE + ".open_media")
mocker.patch(MODULE + ".PLATFORM", platform)
mocker.patch("zulipterminal.platform_code.PLATFORM", platform)
mocker.patch("zulipterminal.core.Controller.show_media_confirmation_popup")

process_media(controller, link)
Expand Down
3 changes: 2 additions & 1 deletion zulipterminal/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ def process_media(controller: Any, link: str) -> None:
controller.view.set_footer_text, "Downloading your media..."
)
media_path = download_media(controller, link, show_download_status)
media_path = normalized_file_path(media_path)
tool = ""

# TODO: Add support for other platforms as well.
Expand Down Expand Up @@ -825,7 +826,7 @@ def download_media(
show_download_status()

controller.report_success([" Downloaded ", ("bold", media_name)])
return normalized_file_path(local_path)
return local_path


@asynch
Expand Down

0 comments on commit 40d4425

Please sign in to comment.