Exemplo n.º 1
0
def test_palette_no_such_colour():
    """
    If given an unknown colour or value that can't be converted from HEX then
    raise a ValueError.
    """
    with pytest.raises(ValueError):
        palette("foobarbaz")
Exemplo n.º 2
0
def test_palette_colour_name_capitalised():
    """
    If given a colour name (e.g. "RED"), return a tuple representing
    the Kivy colour.
    """
    result = palette("RED")
    assert isinstance(result, tuple)
Exemplo n.º 3
0
def test_palette_html_hex():
    """
    If given an HTML hex value as a string (e.g. "#FFCC99"), return a tuple
    representing a Kivy colour.
    """
    result = palette("#FFFFFF")
    assert result == (1.0, 1.0, 1.0)
Exemplo n.º 4
0
def test_palette_colour_name():
    """
    If given a known colour name (e.g. "red"), return a tuple representing
    the Kivy colour.
    """
    result = palette("red")
    assert isinstance(result, tuple)