def test_rmitalic_multiple_styles(): text = "Hello" assert rmitalic(cross(italic(text))) == cross(text) assert rmitalic(bold(italic(text))) == bold(text) assert rmitalic(dim(italic(text))) == dim(text) assert rmitalic(blink(italic(text))) == blink(text) assert rmitalic(underline(italic(text))) == underline(text) assert rmitalic(double_underline(italic(text))) == double_underline(text) # more than one in a raw assert rmitalic(bold(dim(italic(text)))) == bold(dim(text)) assert rmitalic(blink(underline(double_underline(bold(italic(text)))))) == blink( underline(double_underline(bold(text))) ) # other syntax assert rmitalic(colorize(text, s="bic")) == colorize(text, s="bc") assert rmitalic(colorize(text, s="bicuU")) == colorize(text, s="bcuU")
def test_visual(): print( f"This is {coloring.green('green')} and this is {coloring.red('red')}") coloring.print_green("All this text is green") coloring.print_blue("And all this text is blue") coloring.print_yellow("And this text is yello AND BOLD") print( "Styles", coloring.bold("bold"), "nothing", coloring.underline("underline"), "nothing", coloring.double_underline("double_underline"), "nothing", coloring.cross("cross"), "nothing", coloring.blink("blink"), "nothing", coloring.italic("italic"), "nothing", coloring.dim("dim"), "nothing", )
def test_many(): text = "Hello" styled_text = underline(cross(text)) assert styled_text == f"{UNDERLINE}{CROSS}{text}{RESET_CROSS}{RESET_UNDERLINE}"
def test_underline(): text = "Hello" styled_text = underline(text) assert styled_text == f"{UNDERLINE}{text}{RESET_UNDERLINE}"
def test_rmunderline(): text = "Hello" assert rmunderline(underline(text)) == text assert rmunderline(double_underline(text)) == text
def test_rmgraphics(): text = "Hello" assert rmgraphics(underline(bold(text))) == text assert rmgraphics(italic(colorize(text))) == text assert rmgraphics(colorize(text, c="red", s="uUcb", bg="yellow")) == text assert rmgraphics(colorize(text, c=(23, 12, 34), s="i", bg="red")) == text