Skip to content

Commit 5a821d0

Browse files
committed
bugfix: tests: Fix tests failing on WSL systems.
Addressed issues with file path separators `\\` and GUI return codes specific to WSL environments.
1 parent 440a3fa commit 5a821d0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/helper/test_helper.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
process_media,
2222
sort_unread_topics,
2323
)
24+
from zulipterminal.platform_code import PLATFORM
2425

2526

2627
MODULE = "zulipterminal.helper"
@@ -539,6 +540,9 @@ def test_download_media(
539540
) = media_path
540541
controller = mocker.Mock()
541542

543+
if PLATFORM == "WSL":
544+
media_path = media_path.replace("/", "\\")
545+
542546
assert media_path == download_media(controller, url, callback)
543547

544548

@@ -604,14 +608,14 @@ def test_process_media_empty_url(
604608
@pytest.mark.parametrize(
605609
"returncode, error",
606610
[
607-
(0, []),
611+
(1 if PLATFORM == "WSL" else 0, []),
608612
(
609-
1,
613+
0 if PLATFORM == "WSL" else 1,
610614
[
611615
" The tool ",
612616
("footer_contrast", "xdg-open"),
613617
" did not run successfully" ". Exited with ",
614-
("footer_contrast", "1"),
618+
("footer_contrast", "0" if PLATFORM == "WSL" else "1"),
615619
],
616620
),
617621
],

0 commit comments

Comments
 (0)