Пример #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
def test_illegal5():
    with pytest.raises(ValueError):
        colors.color_to_rgb((256, 0, 0))
Пример #9
0
def test_rgba_vs_rgb_conflict():
    with pytest.raises(ValueError):
        colors.color_to_rgb('#949494E8')
Пример #10
0
def test_illegal4():
    with pytest.raises(ValueError):
        colors.color_to_rgb((0, 0, 256))
Пример #11
0
def test_illegal3():
    with pytest.raises(ValueError):
        colors.color_to_rgb((300, 300, 300))
Пример #12
0
def test_illegal2():
    with pytest.raises(ValueError):
        colors.color_to_rgb((1, 2, 3, 256))
Пример #13
0
def test_valid_hexcodes_rgb(name, expected):
    rgb = colors.color_to_rgb(name)
    assert 3 == len(rgb)
    assert expected == rgb
Пример #14
0
def test_illegal():
    with pytest.raises(ValueError):
        colors.color_to_rgb('unknown')