Example #1
0
def test_fg_lookup_nonexist():
    with pytest.raises(ValueError):
        ansi.fg_lookup('foo')
Example #2
0
def test_fg_lookup_exist():
    fg_color = 'green'
    assert ansi.fg_lookup(fg_color) == ansi.FG_COLORS[fg_color]
Example #3
0
 class Matching(ansi.ColorBase):
     magenta = ansi.fg_lookup('magenta')
     purple = ansi.fg_lookup('magenta')
Example #4
0
def test_color_enum():
    assert ansi.fg_lookup('bright_red') == ansi.fg_lookup(ansi.fg.bright_red)
    assert ansi.bg_lookup('green') == ansi.bg_lookup(ansi.bg.green)
Example #5
0
def test_fg_lookup_exist():
    fg_color = 'green'
    assert ansi.fg_lookup(fg_color) == ansi.fg_lookup(ansi.fg.green)