def test_load_jpg(): """Load jpg fixture Can't check for color here, because compression changes it. """ parameters = {'path': 'green-dot.jpg'} images.load(parameters)
def test_load_png(): """Load png fixture and check pixel color Using assert_array_equal which is the suitable solution for arrays. """ parameters = {'path': 'green-dot.png'} img = images.load(parameters) numpy.testing.assert_array_equal(img[10, 5], [0, 255, 0])
def test_load_fail(): """Fail to load file with unkown extension""" parameters = {'path': 'foo.bar'} images.load(parameters)