def test_Colourise_invalid_colour(): with raises(TypeError): template.colourise('s', 'mauve with a hint of green')
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
def test_invalid_colour(self): assert_equals(template.colourise('s', 'mauve with a hint of green'), 's')
def test_attribute(self): assert_equals(template.colourise('s', 'bold'), u'\x1b[1ms\x1b[m\x1b(B')
def test_background_color(self): assert_equals(template.colourise('s', 'on blue'), u'\x1b[48;5;4ms\x1b[m\x1b(B')
def test_color(self): assert_equals(template.colourise('s', 'red'), u'\x1b[38;5;1ms\x1b[m\x1b(B')