'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/114
Tests that adding a PrimaryHDU to a new HDUList object updates the
EXTEND keyword on that HDU.'

def test_new_hdulist_extend_keyword(self):

    h0 = fits.Header()
    hdu = fits.PrimaryHDU(header=h0)
    sci = fits.ImageHDU(data=np.array(10))
    image = fits.HDUList([hdu, sci])
    image.writeto(self.temp('temp.fits'))
    assert ('EXTEND' in hdu.header)
    assert (hdu.header['EXTEND'] is True)
