'Test extending a header both with and without stripping cards from the
extension header.'

def test_header_extend(self):

    hdu = fits.PrimaryHDU()
    hdu2 = fits.ImageHDU()
    hdu2.header['MYKEY'] = ('some    val', 'some    comment')
    hdu.header += hdu2.header
    assert (len(hdu.header) == 5)
    assert (hdu.header[(-1)] == 'some    val')
    hdu = fits.PrimaryHDU()
    hdu.header = (hdu.header + hdu2.header)
    assert (len(hdu.header) == 5)
    assert (hdu.header[(-1)] == 'some    val')
    hdu.header.extend(hdu2.header, strip=False)
    assert (len(hdu.header) == 11)
    assert (list(hdu.header)[5] == 'XTENSION')
    assert (hdu.header[(-1)] == 'some    val')
    assert (('MYKEY', 1) in hdu.header)
