Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_rgb_to_ansi():
assert rgb_to_ansi(None) is None
assert rgb_to_ansi('#8ab6d') is None
assert rgb_to_ansi('#8ab6d2f') == '\x1b[38;2;138;182;210m'
assert rgb_to_ansi('red') is None
assert rgb_to_ansi('#8ab6d2') == '\x1b[38;2;138;182;210m'
def test_rgb_to_ansi():
assert rgb_to_ansi(None) is None
assert rgb_to_ansi('#8ab6d') is None
assert rgb_to_ansi('#8ab6d2f') == '\x1b[38;2;138;182;210m'
assert rgb_to_ansi('red') is None
assert rgb_to_ansi('#8ab6d2') == '\x1b[38;2;138;182;210m'
def test_rgb_to_ansi():
assert rgb_to_ansi(None) is None
assert rgb_to_ansi('#8ab6d') is None
assert rgb_to_ansi('#8ab6d2f') == '\x1b[38;2;138;182;210m'
assert rgb_to_ansi('red') is None
assert rgb_to_ansi('#8ab6d2') == '\x1b[38;2;138;182;210m'
def test_rgb_to_ansi():
assert rgb_to_ansi(None) is None
assert rgb_to_ansi('#8ab6d') is None
assert rgb_to_ansi('#8ab6d2f') == '\x1b[38;2;138;182;210m'
assert rgb_to_ansi('red') is None
assert rgb_to_ansi('#8ab6d2') == '\x1b[38;2;138;182;210m'
def test_rgb_to_ansi():
assert rgb_to_ansi(None) is None
assert rgb_to_ansi('#8ab6d') is None
assert rgb_to_ansi('#8ab6d2f') == '\x1b[38;2;138;182;210m'
assert rgb_to_ansi('red') is None
assert rgb_to_ansi('#8ab6d2') == '\x1b[38;2;138;182;210m'