'Test opening a file-like object in update mode and resizing the
HDU.'

def test_update_filelike(self):

    sf = io.BytesIO()
    arr = np.zeros((100, 100))
    hdu = fits.PrimaryHDU(data=arr)
    hdu.writeto(sf)
    sf.seek(0)
    arr = np.zeros((200, 200))
    hdul = fits.open(sf, mode='update')
    hdul[0].data = arr
    hdul.flush()
    sf.seek(0)
    hdul = fits.open(sf)
    assert (len(hdul) == 1)
    assert (hdul[0].data == arr).all()
