'Test to ensure that when Numpy-style record formats are passed in to
the Column constructor for the format argument, they are recognized so
long as it\'s unambiguous (where "unambiguous" here is questionable
since Numpy is case insensitive when parsing the format codes.  But
their "proper" case is lower-case, so we can accept that.  Basically,
actually, any key in the NUMPY2FITS dict should be accepted.'

def test_column_format_interpretation(self):

    for (recformat, fitsformat) in NUMPY2FITS.items():
        c = fits.Column('TEST', np.dtype(recformat))
        (c.format == fitsformat)
        c = fits.Column('TEST', recformat)
        (c.format == fitsformat)
        c = fits.Column('TEST', fitsformat)
        (c.format == fitsformat)
    c = fits.Column('TEST', 'I4')
    assert (c.format == 'I4')
    assert (c.format.format == 'I')
    assert (c.format.width == 4)
    c = fits.Column('TEST', 'F15.8')
    assert (c.format == 'F15.8')
    assert (c.format.format == 'F')
    assert (c.format.width == 15)
    assert (c.format.precision == 8)
    c = fits.Column('TEST', 'E15.8')
    assert (c.format.format == 'E')
    assert (c.format.width == 15)
    assert (c.format.precision == 8)
    c = fits.Column('TEST', 'D15.8')
    assert (c.format.format == 'D')
    assert (c.format.width == 15)
    assert (c.format.precision == 8)
    c = fits.Column('TEST', 'F10.0')
    assert (c.format.format == 'F')
    assert (c.format.width == 10)
    assert (c.format.precision == 0)
    c = fits.Column('TEST', 'E10.0')
    assert (c.format.format == 'E')
    assert (c.format.width == 10)
    assert (c.format.precision == 0)
    c = fits.Column('TEST', 'D10.0')
    assert (c.format.format == 'D')
    assert (c.format.width == 10)
    assert (c.format.precision == 0)
    c = fits.Column('TEST', 'I')
    assert (c.format == 'I')
    assert (c.format.recformat == 'i2')
    c = fits.Column('TEST', 'I', ascii=True)
    assert (c.format == 'I10')
    c = fits.Column('TEST', 'E')
    assert (c.format == 'E')
    assert (c.format.recformat == 'f4')
    c = fits.Column('TEST', 'E', ascii=True)
    assert (c.format == 'E15.7')
    c = fits.Column('TEST', 'F')
    assert (c.format == 'F16.7')
    c = fits.Column('TEST', 'D')
    assert (c.format == 'D')
    assert (c.format.recformat == 'f8')
    c = fits.Column('TEST', 'D', ascii=True)
    assert (c.format == 'D25.17')
