Exemple #1
0
def test_string_gets_styled_cyan_background():
    assert Escape('hello').cyan_background() == '\x1b[46mhello\x1b[49m'
Exemple #2
0
def test_string_gets_styled_red_background():
    assert Escape('hello').red_background() == '\x1b[41mhello\x1b[49m'
Exemple #3
0
def test_string_gets_styled_bright_green_background():
    assert Escape('hello').bright_green_background() == '\x1b[102mhello\x1b[49m'
Exemple #4
0
def test_string_gets_styled_bright_cyan():
    assert Escape('hello').bright_cyan() == '\x1b[96mhello\x1b[39m'
Exemple #5
0
def test_string_gets_styled_bright_white():
    assert Escape('hello').bright_white() == '\x1b[97mhello\x1b[39m'
Exemple #6
0
def test_string_gets_styled_yellow():
    assert Escape('hello').yellow() == '\x1b[33mhello\x1b[39m'
Exemple #7
0
def test_string_gets_styled_bright_magenta():
    assert Escape('hello').bright_magenta() == '\x1b[95mhello\x1b[39m'
Exemple #8
0
def test_string_gets_styled_inverse():
    assert Escape('hello').inverse() == '\x1b[7mhello\x1b[27m'
Exemple #9
0
def test_string_gets_hidden():
    assert Escape('hello').hidden() == '\x1b[8mhello\x1b[28m'
Exemple #10
0
def test_string_gets_styled_dim():
    assert Escape('hello').dim() == '\x1b[2mhello\x1b[22m'
Exemple #11
0
def test_string_gets_styled_italic():
    assert Escape('hello').italic() == '\x1b[3mhello\x1b[23m'
Exemple #12
0
def test_string_gets_styled_bold():
    assert Escape('hello').bold() == '\x1b[1mhello\x1b[22m'
Exemple #13
0
def test_string_gets_styled_red():
    assert Escape('hello').red() == '\x1b[31mhello\x1b[39m'
Exemple #14
0
def test_string_gets_styled_white_background():
    assert Escape('hello').white_background() == '\x1b[47mhello\x1b[49m'
Exemple #15
0
def test_using_unicode_codepoints_does_not_raise():
    Escape(u'\u0150 ', Escape('Hello').bright_green_background()).bright_red()
Exemple #16
0
def test_string_gets_striked_through():
    assert Escape('hello').strikethrough() == '\x1b[9mhello\x1b[29m'
Exemple #17
0
def test_string_gets_styled_bright_green():
    assert Escape('hello').bright_green() == u'\x1b[92mhello\x1b[39m'
Exemple #18
0
def test_string_gets_underlined():
    assert Escape('hello').underline() == '\x1b[4mhello\x1b[24m'
Exemple #19
0
def test_string_gets_styled_magenta():
    assert Escape('hello').magenta() == '\x1b[35mhello\x1b[39m'
Exemple #20
0
def test_multiple_styles_get_applied():
    assert Escape('Hello World').red().blue() == '\x1b[34m\x1b[31mHello World\x1b[39m\x1b[39m'
Exemple #21
0
def test_string_gets_styled_cyan():
    assert Escape('hello').cyan() == '\x1b[36mhello\x1b[39m'
Exemple #22
0
def test_conatenate_with_other_strings():
    assert Escape('hello') + ' world' == 'hello world'
    assert 'world,' + Escape('Hi!').green() == 'world,\x1b[32mHi!\x1b[39m'
Exemple #23
0
def test_string_gets_styled_white():
    assert Escape('hello').white() == '\x1b[37mhello\x1b[39m'
Exemple #24
0
def test_styles_get_nested():
    assert (Escape('Hello ' + Escape('World')
                   .bright_green_background())
            .bright_red()) == '\x1b[91mHello \x1b[102mWorld\x1b[49m\x1b[39m'
Exemple #25
0
def test_string_gets_styled_gray():
    assert Escape('hello').gray() == '\x1b[90mhello\x1b[39m'
Exemple #26
0
def test_length_returns_length_of_unstyled_string():
    assert len(Escape('Hello').red()) == len('Hello')
Exemple #27
0
def test_string_gets_styled_black():
    assert Escape('hello').black() == '\x1b[30mhello\x1b[39m'
Exemple #28
0
def test_multiply_creates_repeated_styled_string():
    assert Escape('red').red() * 3 == '\x1b[31mred\x1b[39m\x1b[31mred\x1b[39m\x1b[31mred\x1b[39m'
Exemple #29
0
def test_string_gets_styled_yellow_background():
    assert Escape('hello').yellow_background() == '\x1b[43mhello\x1b[49m'
Exemple #30
0
def test_string_gets_styled_bright_magenta_background():
    assert Escape('hello').bright_magenta_background() == '\x1b[105mhello\x1b[49m'