'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/106
Open files with end padding bytes.'

def test_open_file_with_end_padding(self):

    hdul = fits.open(self.data('test0.fits'), do_not_scale_image_data=True)
    info = hdul.info(output=False)
    hdul.writeto(self.temp('temp.fits'))
    with open(self.temp('temp.fits'), 'ab') as f:
        f.seek(0, os.SEEK_END)
        f.write(('\x00' * 2880))
    with ignore_warnings():
        assert (info == fits.info(self.temp('temp.fits'), output=False, do_not_scale_image_data=True))
