Skip to content

Commit cebc43b

Browse files
committed
Added test coverage.
1 parent 78fe196 commit cebc43b

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

tests/test_theme.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,32 @@ def test_pt_theme_is_none() -> None:
142142
assert get_pt_theme() is not None
143143

144144

145+
def test_sync_all_theme_is_none() -> None:
146+
"""Test that calling _sync_all() when _THEME is None is a no-op."""
147+
from cmd2 import theme
148+
149+
theme._THEME = None
150+
theme._PT_THEME = None
151+
152+
theme._sync_all()
153+
154+
assert theme._THEME is None
155+
assert theme._PT_THEME is None
156+
157+
158+
def test_sync_pt_theme_theme_is_none() -> None:
159+
"""Test that calling _sync_pt_theme() when _THEME is None is a no-op."""
160+
from cmd2 import theme
161+
162+
theme._THEME = None
163+
theme._PT_THEME = None
164+
165+
theme._sync_pt_theme()
166+
167+
assert theme._THEME is None
168+
assert theme._PT_THEME is None
169+
170+
145171
def test_register_pt_mapping() -> None:
146172
"""Test style registration with UI mapping."""
147173
style_name = "my_custom_scrollbar"

0 commit comments

Comments
 (0)