def test_color_setter_wrong_colors(self): l = Lineage( np.random.random((10, 3)), names=["foo", "bar", "baz"], colors=[(0, 0, 0), (0.5, 0.5, 0.5), (1, 1, 1)], ) with pytest.raises(ValueError): l.colors = ["#ffffff", "#ffffff", "foo"]
def test_colors_setter(self): l = Lineage( np.random.random((10, 3)), names=["foo", "bar", "baz"], colors=[(0, 0, 0), (0.5, 0.5, 0.5), (1, 1, 1)], ) colors = ["#ffffff", "#ffffff", "#ffffff"] l.colors = colors np.testing.assert_array_equal(l.colors, np.array(colors))