mirror of
https://github.com/ihabunek/toot
synced 2025-01-25 13:08:35 +01:00
Added sanity check tests to ensure PALETTE and MONO_PALETTE match
And fixed a bug uncovered by the above tests :)
This commit is contained in:
parent
219225ba8a
commit
28a3343761
15
tests/test_constants.py
Normal file
15
tests/test_constants.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from toot.tui.constants import PALETTE, MONO_PALETTE
|
||||||
|
|
||||||
|
|
||||||
|
def test_palette():
|
||||||
|
# for every entry in PALETTE, there must be
|
||||||
|
# a corresponding entry in MONO_PALETTE
|
||||||
|
for pal in PALETTE:
|
||||||
|
matches = [item for item in MONO_PALETTE if item[0] == pal[0]]
|
||||||
|
assert len(matches) > 0, f"{pal}, present in PALETTE, missing from MONO_PALETTE"
|
||||||
|
|
||||||
|
# for every entry in MONO_PALETTE, there must be
|
||||||
|
# a corresponding entry in PALETTE
|
||||||
|
for pal in MONO_PALETTE:
|
||||||
|
matches = [item for item in PALETTE if item[0] == pal[0]]
|
||||||
|
assert len(matches) > 0, f"{pal}, present in MONO_PALETTE, missing from PALETTE"
|
@ -75,7 +75,6 @@ MONO_PALETTE = [
|
|||||||
('warning', 'white,bold', 'black'),
|
('warning', 'white,bold', 'black'),
|
||||||
|
|
||||||
# Functional
|
# Functional
|
||||||
('account', 'dark green', ''),
|
|
||||||
('hashtag_followed', 'white,bold', ''),
|
('hashtag_followed', 'white,bold', ''),
|
||||||
('hashtag', 'white,bold', ''),
|
('hashtag', 'white,bold', ''),
|
||||||
('link', ',italics', ''),
|
('link', ',italics', ''),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user