'Regression test on `FitsHDU.fromfile`'

def test_create_fitshdu_from_filename(self):

    a = np.arange(100)
    phdu = fits.PrimaryHDU(data=a)
    phdu.header['TEST1'] = 'A'
    phdu.header['TEST2'] = 'B'
    imghdu = fits.ImageHDU(data=(a + 1))
    phdu.header['TEST3'] = 'C'
    phdu.header['TEST4'] = 'D'
    hdul = fits.HDUList([phdu, imghdu])
    hdul.writeto(self.temp('test.fits'))
    fitshdu = fits.FitsHDU.fromfile(self.temp('test.fits'))
    hdul2 = fitshdu.hdulist
    assert (len(hdul2) == 2)
    assert fits.FITSDiff(hdul, hdul2).identical
