'Tests appending a Simple PrimaryHDU to a non-empty HDUList.'

def test_append_primary_to_non_empty_list(self):

    hdul = fits.open(self.data('arange.fits'))
    hdu = fits.PrimaryHDU(np.arange(100, dtype=np.int32))
    hdul.append(hdu)
    info = [(0, 'PRIMARY', 1, 'PrimaryHDU', 7, (11, 10, 7), 'int32', ''), (1, '', 1, 'ImageHDU', 6, (100,), 'int32', '')]
    assert (hdul.info(output=False) == info)
    hdul.writeto(self.temp('test-append.fits'))
    assert (fits.info(self.temp('test-append.fits'), output=False) == info)
