Exemplo n.º 1
0
def test_extended_background_named():
    colour = pixy.ExtendedColour(10, background=True)
    assert colour.code == "\x1b[48;5;10m"
Exemplo n.º 2
0
def test_extended_max_boundary():
    assert isinstance(pixy.ExtendedColour(255), pixy.ExtendedColour)

    with pytest.raises(ValueError):
        pixy.ExtendedColour(255 + 1)
Exemplo n.º 3
0
def test_extended_foreground():
    colour = pixy.ExtendedColour(10)
    assert colour.code == "\x1b[38;5;10m"
Exemplo n.º 4
0
def test_extended_colour_add():
    e = pixy.ExtendedColour(10) + pixy.EscapeSequence(3, 4)

    assert isinstance(e, pixy.EscapeSequence)
    assert e == pixy.EscapeSequence(38, 5, 10, 3, 4)