'Test verify options like fix+ignore.'

def test_combined_verify_options(self):

    def make_invalid_hdu():
        hdu = fits.ImageHDU()
        c1 = fits.Card.fromstring("test                =    '                test'")
        c2 = fits.Card.fromstring("P.I.                =    '        Hubble'")
        hdu.header.append(c1)
        hdu.header.append(c2)
        return hdu
    hdu = make_invalid_hdu()
    with catch_warnings():
        warnings.simplefilter('error')
        try:
            hdu.verify('silentfix+ignore')
        except Exception as exc:
            self.fail('An    exception    occurred    when    the    verification    error    should    have    been    ignored:    {}'.format(exc))
    hdu = make_invalid_hdu()
    with catch_warnings() as w:
        hdu.verify('silentfix+warn')
        assert (len(w) == 4)
        assert ('Illegal    keyword    name' in str(w[2].message))
    hdu = make_invalid_hdu()
    try:
        hdu.verify('silentfix+exception')
    except fits.VerifyError as exc:
        assert ('Illegal    keyword    name' in str(exc))
        assert ('not    upper    case' not in str(exc))
    else:
        self.fail('An    exception    should    have    been    raised.')
    hdu = make_invalid_hdu()
    with catch_warnings() as w:
        hdu.verify('fix+ignore')
        assert (len(w) == 4)
        assert ('not    upper    case' in str(w[2].message))
    hdu = make_invalid_hdu()
    with catch_warnings() as w:
        hdu.verify('fix+warn')
        assert (len(w) == 6)
        assert ('not    upper    case' in str(w[2].message))
        assert ('Illegal    keyword    name' in str(w[4].message))
    hdu = make_invalid_hdu()
    try:
        hdu.verify('fix+exception')
    except fits.VerifyError as exc:
        assert ('Illegal    keyword    name' in str(exc))
        assert ('not    upper    case' in str(exc))
    else:
        self.fail('An    exception    should    have    been    raised.')
