def test_constructor_copies_header(self):

        ifd = fits.HDUList([fits.PrimaryHDU(), fits.BinTableHDU()])
        thdr = ifd[1].header
        thdr['FILENAME'] = 'labq01i3q_rawtag.fits'

        thdu = fits.BinTableHDU(header=thdr)
        ofd = fits.HDUList(thdu)
        ofd[0].header['FILENAME'] = 'labq01i3q_flt.fits'

        # Original header should be unchanged
        assert thdr['FILENAME'] == 'labq01i3q_rawtag.fits'
Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/153
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/tests/test_table.py/TestTableFunctions.test_constructor_copies_header