def test_make_png():
 rgba_save = np.random.randint(256, size=(100, 100, 4)).astype(np.ubyte)
 rgb_save = rgba_save[:, :, :3]
 png_out = op.join(temp_dir, 'random.png')
 for rgb_a in (rgba_save, rgb_save):
  write_png(png_out, rgb_a)
  rgb_a_read = read_png(png_out)
  assert_array_equal(rgb_a, rgb_a_read)

def test_make_png ( ) : rgba_save = np . random . randint ( 256 , size = ( 100 , 100 , 4 ) ) . astype ( np . ubyte ) rgb_save = rgba_save [ : , : , : 3 ] png_out = op . join ( temp_dir , 'random.png' ) for rgb_a in ( rgba_save , rgb_save ) : write_png ( png_out , rgb_a ) rgb_a_read = read_png ( png_out ) assert_array_equal ( rgb_a , rgb_a_read )
test to ensure that make_png functions correctly .