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