from toot.output import colorize, strip_tags, STYLES
reset = STYLES["reset"]
red = STYLES["red"]
green = STYLES["green"]
bold = STYLES["bold"]
def test_colorize():
assert colorize("foo") == "foo"
assert colorize("foo") == f"{red}foo{reset}{reset}"
assert colorize("foo bar baz") == f"foo {red}bar{reset} baz{reset}"
assert colorize("foo bar baz") == f"foo {red}{bold}bar{reset} baz{reset}"
assert colorize("foo bar baz") == f"foo {red}{bold}bar{reset}{bold} baz{reset}"
assert colorize("foo bar> baz") == f"foo {red}{bold}bar{reset} baz{reset}"
assert colorize("foobarbaz") == f"{red}foo{bold}bar{reset}{red}baz{reset}{reset}"
def test_strip_tags():
assert strip_tags("foo") == "foo"
assert strip_tags("foo") == "foo"
assert strip_tags("foo bar baz") == "foo bar baz"
assert strip_tags("foo bar baz") == "foo bar baz"
assert strip_tags("foo bar baz") == "foo bar baz"
assert strip_tags("foo bar> baz") == "foo bar baz"
assert strip_tags("foobarbaz") == "foobarbaz"