def test_transform_color_wrong_colorlen(): shape = (10, 2) np.random.seed(0) data = 20 * np.random.random(shape) with pytest.warns(UserWarning): colorarray = transform_color_with_defaults( num_entries=len(data), colors=['r', 'r'], elem_name='face_color', default='black', ) np.testing.assert_array_equal(colorarray, ColorArray('black').rgba)
def test_transform_color_basic(): """Test inner method with the same name.""" shape = (10, 2) np.random.seed(0) data = 20 * np.random.random(shape) colorarray = transform_color_with_defaults( num_entries=len(data), colors='r', elem_name='edge_color', default='black', ) np.testing.assert_array_equal(colorarray, ColorArray('r').rgba)