Skip to content

Commit ccede63

Browse files
committed
test: Add tests for detected platform.
Adds tests for checking what platform is detected.
1 parent 8bdd944 commit ccede63

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/cli/test_run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
parse_args,
1818
)
1919
from zulipterminal.model import ServerConnectionFailure
20+
from zulipterminal.platform_code import PLATFORM
2021
from zulipterminal.version import ZT_VERSION
2122

2223

@@ -132,6 +133,7 @@ def test_valid_zuliprc_but_no_connection(
132133

133134
lines = captured.out.strip().split("\n")
134135
expected_lines = [
136+
"Detected Platform: " + PLATFORM,
135137
"Loading with:",
136138
" theme 'zt_dark' specified with no config.",
137139
" autohide setting 'no_autohide' specified with no config.",
@@ -182,6 +184,7 @@ def test_warning_regarding_incomplete_theme(
182184

183185
lines = captured.out.strip().split("\n")
184186
expected_lines = [
187+
"Detected Platform: " + PLATFORM,
185188
"Loading with:",
186189
f" theme '{bad_theme}' specified on command line.",
187190
"\x1b[93m WARNING: Incomplete theme; results may vary!",
@@ -395,6 +398,7 @@ def test_successful_main_function_with_config(
395398
captured = capsys.readouterr()
396399
lines = captured.out.strip().split("\n")
397400
expected_lines = [
401+
f"Detected Platform: {PLATFORM}",
398402
"Loading with:",
399403
" theme 'zt_dark' specified in zuliprc file (by alias 'default').",
400404
" autohide setting 'autohide' specified in zuliprc file.",

zulipterminal/ui_tools/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,10 @@ def __init__(
11321132
("Notifications", "enabled" if notify_enabled else "disabled"),
11331133
],
11341134
),
1135-
("Platform", [("Detected Platform", PLATFORM if PLATFORM else "Invalid Platform")])
1135+
(
1136+
"Platform",
1137+
[("Detected Platform", PLATFORM if PLATFORM else "Invalid Platform")],
1138+
),
11361139
]
11371140

11381141
popup_width, column_widths = self.calculate_table_widths(contents, len(title))

0 commit comments

Comments
 (0)