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_strip_ansi():
assert strip_ansi(cli.format("foobar", cli.GREEN)) == "foobar"
assert strip_ansi(cli.format("barfoo", cli.BOLD)) == "barfoo"
def _assert_format(string, type_):
assert cli.format(string, type_) == "{}{}{}".format(type_, string, cli.CLEAR)
def test_strip_ansi():
assert strip_ansi(cli.format("foobar", cli.GREEN)) == "foobar"
assert strip_ansi(cli.format("barfoo", cli.BOLD)) == "barfoo"
def cli_format(string, type_):
args = get_args(as_dict = False)
if hasattr(args, "no_color") and not args.no_color:
string = cli.format(string, type_)
return string