import numpy as np
import rasterio

def test_reshape():
    with rasterio.open('tests/data/RGB.byte.tif') as src:
        im_data = rasterio.plot.reshape_as_image(src.read())
        assert im_data.shape == (718, 791, 3)

def test_toundtrip_reshape():
    with rasterio.open('tests/data/RGB.byte.tif') as src:
        data = src.read()
        im_data = rasterio.plot.reshape_as_image(data)
        assert np.array_equal(data, rasterio.plot.reshape_as_raster(im_data))

import numpy as np
import rasterio

def test_reshape():
    with rasterio.open('tests/data/RGB.byte.tif') as src:
        im_data = rasterio.plot.reshape_as_image(src)
        assert im_data.shape == (718, 791, 3)

def test_toundtrip_reshape():
    with rasterio.open('tests/data/RGB.byte.tif') as src:
        data = src.read()
        im_data = rasterio.plot.reshape_as_image(data)
        assert np.array_equal(data, rasterio.plot.reshape_as_raster(im_data))

--- 
+++ 
@@ -3,7 +3,7 @@
 
 def test_reshape():
     with rasterio.open('tests/data/RGB.byte.tif') as src:
-        im_data = rasterio.plot.reshape_as_image(src)
+        im_data = rasterio.plot.reshape_as_image(src.read())
         assert im_data.shape == (718, 791, 3)
 
 def test_toundtrip_reshape():
Update reshape_image test for new decoupled io function
