Skip to content

Commit c4a2882

Browse files
committed
Added unit test for ColorBase.colors()
1 parent 5096a2b commit c4a2882

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_ansi.py

+7
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ def test_color_str_building():
136136
fg.blue.value + bg.white.value + "hello" + fg.reset.value + bg.reset.value
137137

138138

139+
def test_color_nonunique_values():
140+
class Matching(ansi.ColorBase):
141+
magenta = ansi.fg_lookup('magenta')
142+
purple = ansi.fg_lookup('magenta')
143+
assert sorted(Matching.colors()) == ['magenta', 'purple']
144+
145+
139146
def test_color_enum():
140147
assert ansi.fg_lookup('bright_red') == ansi.fg_lookup(ansi.fg.bright_red)
141148
assert ansi.bg_lookup('green') == ansi.bg_lookup(ansi.bg.green)

0 commit comments

Comments
 (0)