Exemple #1
0
def test_rgba_vs_rgb_conflict():
    with pytest.raises(ValueError):
        colors.color_to_rgb('#949494E8')
Exemple #2
0
def test_illegal4():
    with pytest.raises(ValueError):
        colors.color_to_rgb((0, 0, 256))
Exemple #3
0
def test_illegal5():
    with pytest.raises(ValueError):
        colors.color_to_rgb((256, 0, 0))
Exemple #4
0
def test_illegal2():
    with pytest.raises(ValueError):
        colors.color_to_rgb((1, 2, 3, 256))
Exemple #5
0
def test_illegal3():
    with pytest.raises(ValueError):
        colors.color_to_rgb((300, 300, 300))
Exemple #6
0
def test_illegal():
    with pytest.raises(ValueError):
        colors.color_to_rgb('unknown')
Exemple #7
0
def test_valid_hexcodes_rgb(name, expected):
    rgb = colors.color_to_rgb(name)
    assert 3 == len(rgb)
    assert expected == rgb
Exemple #8
0
def test_illegal5():
    with pytest.raises(ValueError):
        colors.color_to_rgb((256, 0, 0))
Exemple #9
0
def test_rgba_vs_rgb_conflict():
    with pytest.raises(ValueError):
        colors.color_to_rgb('#949494E8')
Exemple #10
0
def test_illegal4():
    with pytest.raises(ValueError):
        colors.color_to_rgb((0, 0, 256))
Exemple #11
0
def test_illegal3():
    with pytest.raises(ValueError):
        colors.color_to_rgb((300, 300, 300))
Exemple #12
0
def test_illegal2():
    with pytest.raises(ValueError):
        colors.color_to_rgb((1, 2, 3, 256))
Exemple #13
0
def test_valid_hexcodes_rgb(name, expected):
    rgb = colors.color_to_rgb(name)
    assert 3 == len(rgb)
    assert expected == rgb
Exemple #14
0
def test_illegal():
    with pytest.raises(ValueError):
        colors.color_to_rgb('unknown')