Skip to content

Commit

Permalink
refactor/bugfix: helper: Normalize file path in process_media.
Browse files Browse the repository at this point in the history
This removes platform-dependence from download_media, and for now leaves
more in process_media, which already had a platform-dependent test.

This addresses a failing test in WSL environments in download_media,
which is no longer dependent upon the platform.
  • Loading branch information
rsashank authored and neiljp committed Jul 5, 2024
1 parent 967d762 commit 9bfe0e0
Showing 1 changed file with 2 additions and 1 deletion.
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 9bfe0e0

Please sign in to comment.