1
0
Fork 0
colorclass/tests/test_toggles.py
Daniel Baumann 12d94d2889
Adding upstream version 2.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-07 10:18:23 +01:00

29 lines
801 B
Python

"""Test objects in module."""
from colorclass import toggles
def test_disable():
"""Test functions."""
toggles.disable_all_colors()
assert not toggles.is_enabled()
toggles.enable_all_colors()
assert toggles.is_enabled()
toggles.disable_all_colors()
assert not toggles.is_enabled()
toggles.enable_all_colors()
assert toggles.is_enabled()
assert toggles.disable_if_no_tty() # pytest pipes stderr/stdout.
assert not toggles.is_enabled()
def test_light_bg():
"""Test functions."""
toggles.set_dark_background()
assert not toggles.is_light()
toggles.set_light_background()
assert toggles.is_enabled()
toggles.set_dark_background()
assert not toggles.is_light()
toggles.set_light_background()
assert toggles.is_enabled()