def test_read_file_like_object(self):

        filelike = BytesIO()
        with open(self.data('test0.fits'), 'rb') as f:
            filelike.write(f.read())
        filelike.seek(0)
        with ignore_warnings():
            assert len(fits.open(filelike)) == 5
Test reading a FITS file from a file-like object.
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/tests/test_core.py/TestFileFunctions.test_read_file_like_object