def test_extended_background_named(): colour = pixy.ExtendedColour(10, background=True) assert colour.code == "\x1b[48;5;10m"
def test_extended_max_boundary(): assert isinstance(pixy.ExtendedColour(255), pixy.ExtendedColour) with pytest.raises(ValueError): pixy.ExtendedColour(255 + 1)
def test_extended_foreground(): colour = pixy.ExtendedColour(10) assert colour.code == "\x1b[38;5;10m"
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)