def test_rgba_negative_opacity(self): with pytest.raises(InvalidColorValue): format_color("rgb(128, 32, 60, -0.5)")
def test_rgb_negative(self): with pytest.raises(InvalidColorValue): format_color("rgb(128, -32, 60)")
def test_rgb_overbound(self): with pytest.raises(InvalidColorValue): format_color("rgb(128, 192, 999)")
def test_insufficient_rgb_length(self): with pytest.raises(InvalidColorValue): format_color("rgb(128, 192)")
def test_excessive_rgb_length(self): with pytest.raises(InvalidColorValue): format_color("rgb(32, 64, 92, 128, 255)")
def test_excessive_iterable_length(self): with pytest.raises(InvalidColorValue): format_color([128, 96, 48, 255, 255])
def test_short_hexa(self): assert format_color("cde0") == (204, 221, 238, 0) assert format_color("#ff08") == (255, 255, 0, 136)
def test_iterable(self): assert format_color([32, 64, 128, 72]) == (32, 64, 128, 72)
def test_insufficient_hex_length(self): with pytest.raises(InvalidColorValue): format_color("FF")
def test_rgba(self): assert format_color("rgba(98, 212, 204, 0.89)") == (98, 212, 204, 227)
def test_short_iterable(self): assert format_color(["67", "120", "64"]) == (67, 120, 64, 255)
def test_rgb(self): assert format_color("rgb(75, 109, 26)") == (75, 109, 26, 255)
def test_hexa(self): assert format_color("C0B0D080") == (192, 176, 208, 128) assert format_color("#4B6D321A") == (75, 109, 50, 26)
def test_hex(self): assert format_color("DDA0C4") == (221, 160, 196, 255) assert format_color("#2F4BEF") == (47, 75, 239, 255)
def test_rgba_opacity_overbound(self): with pytest.raises(InvalidColorValue): format_color("rgba(128, 192, 0, 1.5)")
def test_excessive_hex_length(self): with pytest.raises(InvalidColorValue): format_color("FFAABBDDEE")
def test_insufficient_iterable_length(self): with pytest.raises(InvalidColorValue): format_color([64, 128])
def test_non_hex(self): with pytest.raises(InvalidColorValue): format_color("XYZ")
def test_invalid_type(self): with pytest.raises(InvalidColorType): format_color(None) with pytest.raises(InvalidColorType): format_color(192)
def test_short_hex(self): assert format_color("aac") == (170, 170, 204, 255) assert format_color("#da0") == (221, 170, 0, 255)