Beispiel #1
0
def test_Colourise_invalid_colour():
    with raises(TypeError):
        template.colourise('s', 'mauve with a hint of green')
Beispiel #2
0
def test_Colourise_color(fg: str, bg: Optional[str],
                         attributes: Dict[str, bool], expected: str):
    output = template.colourise('s', fg, bg, **attributes)
    assert expected in output
Beispiel #3
0
 def test_invalid_colour(self):
     assert_equals(template.colourise('s', 'mauve with a hint of green'),
                                      's')
Beispiel #4
0
 def test_attribute(self):
     assert_equals(template.colourise('s', 'bold'), u'\x1b[1ms\x1b[m\x1b(B')
Beispiel #5
0
 def test_background_color(self):
     assert_equals(template.colourise('s', 'on blue'),
                                      u'\x1b[48;5;4ms\x1b[m\x1b(B')
Beispiel #6
0
 def test_color(self):
     assert_equals(template.colourise('s', 'red'),
                   u'\x1b[38;5;1ms\x1b[m\x1b(B')