コード例 #1
0
ファイル: test_template.py プロジェクト: JNRowe/hubugs
def test_Colourise_invalid_colour():
    with raises(TypeError):
        template.colourise('s', 'mauve with a hint of green')
コード例 #2
0
ファイル: test_template.py プロジェクト: JNRowe/hubugs
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
コード例 #3
0
ファイル: test_template.py プロジェクト: sorin-ionescu/hubugs
 def test_invalid_colour(self):
     assert_equals(template.colourise('s', 'mauve with a hint of green'),
                                      's')
コード例 #4
0
ファイル: test_template.py プロジェクト: sorin-ionescu/hubugs
 def test_attribute(self):
     assert_equals(template.colourise('s', 'bold'), u'\x1b[1ms\x1b[m\x1b(B')
コード例 #5
0
ファイル: test_template.py プロジェクト: sorin-ionescu/hubugs
 def test_background_color(self):
     assert_equals(template.colourise('s', 'on blue'),
                                      u'\x1b[48;5;4ms\x1b[m\x1b(B')
コード例 #6
0
ファイル: test_template.py プロジェクト: sorin-ionescu/hubugs
 def test_color(self):
     assert_equals(template.colourise('s', 'red'),
                   u'\x1b[38;5;1ms\x1b[m\x1b(B')