def test_bg_lookup_nonexist(): with pytest.raises(ValueError): ansi.bg_lookup('bar')
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)
def test_bg_lookup_exist(): bg_color = 'green' assert ansi.bg_lookup(bg_color) == ansi.BG_COLORS[bg_color]
def test_bg_lookup_exist(): bg_color = 'red' assert ansi.bg_lookup(bg_color) == ansi.bg_lookup(ansi.bg.red)