'Test extending the header with and without unique=True.'

def test_header_extend_unique(self):

    hdu = fits.PrimaryHDU()
    hdu2 = fits.ImageHDU()
    hdu.header['MYKEY'] = ('some    val', 'some    comment')
    hdu2.header['MYKEY'] = ('some    other    val', 'some    other    comment')
    hdu.header.extend(hdu2.header)
    assert (len(hdu.header) == 6)
    assert (hdu.header[(-2)] == 'some    val')
    assert (hdu.header[(-1)] == 'some    other    val')
    hdu = fits.PrimaryHDU()
    hdu2 = fits.ImageHDU()
    hdu.header['MYKEY'] = ('some    val', 'some    comment')
    hdu2.header['MYKEY'] = ('some    other    val', 'some    other    comment')
    hdu.header.extend(hdu2.header, unique=True)
    assert (len(hdu.header) == 5)
    assert (hdu.header[(-1)] == 'some    val')
