コード例 #1
0
def test_rgba_vs_rgb_conflict():
    with pytest.raises(ValueError):
        colors.color_to_rgb('#949494E8')
コード例 #2
0
def test_illegal4():
    with pytest.raises(ValueError):
        colors.color_to_rgb((0, 0, 256))
コード例 #3
0
def test_illegal5():
    with pytest.raises(ValueError):
        colors.color_to_rgb((256, 0, 0))
コード例 #4
0
def test_illegal2():
    with pytest.raises(ValueError):
        colors.color_to_rgb((1, 2, 3, 256))
コード例 #5
0
def test_illegal3():
    with pytest.raises(ValueError):
        colors.color_to_rgb((300, 300, 300))
コード例 #6
0
def test_illegal():
    with pytest.raises(ValueError):
        colors.color_to_rgb('unknown')
コード例 #7
0
def test_valid_hexcodes_rgb(name, expected):
    rgb = colors.color_to_rgb(name)
    assert 3 == len(rgb)
    assert expected == rgb
コード例 #8
0
ファイル: test_colors.py プロジェクト: heuer/segno
def test_illegal5():
    with pytest.raises(ValueError):
        colors.color_to_rgb((256, 0, 0))
コード例 #9
0
ファイル: test_colors.py プロジェクト: heuer/segno
def test_rgba_vs_rgb_conflict():
    with pytest.raises(ValueError):
        colors.color_to_rgb('#949494E8')
コード例 #10
0
ファイル: test_colors.py プロジェクト: heuer/segno
def test_illegal4():
    with pytest.raises(ValueError):
        colors.color_to_rgb((0, 0, 256))
コード例 #11
0
ファイル: test_colors.py プロジェクト: heuer/segno
def test_illegal3():
    with pytest.raises(ValueError):
        colors.color_to_rgb((300, 300, 300))
コード例 #12
0
ファイル: test_colors.py プロジェクト: heuer/segno
def test_illegal2():
    with pytest.raises(ValueError):
        colors.color_to_rgb((1, 2, 3, 256))
コード例 #13
0
ファイル: test_colors.py プロジェクト: heuer/segno
def test_valid_hexcodes_rgb(name, expected):
    rgb = colors.color_to_rgb(name)
    assert 3 == len(rgb)
    assert expected == rgb
コード例 #14
0
ファイル: test_colors.py プロジェクト: heuer/segno
def test_illegal():
    with pytest.raises(ValueError):
        colors.color_to_rgb('unknown')