def METHOD_NAME(self):
    """ Test that the array factory creates valid colormap. """
    colors = array([[0.0, 0.0, 0.0], [1.0, 1.0, 1.0]])
    cm = ColorMapper.from_palette_array(colors)
    cm.range = DataRange1D()
    ar = ArrayDataSource(array([0.0, 0.5, 1.0]))
    cm.range.add(ar)
    b = cm.map_screen(ar.get_data())
    cm.range.remove(ar)
    expected = array([0.0, 0.5, 1.0])
    self.assertTrue(
        allclose(ravel(b[:, :1]), expected, atol=0.02),
        "Array factory failed.  Expected %s.  Got %s"
        % (expected, b[:, :1]),
    )