'Normally the product of the dimensions listed in a TDIMn keyword
must be less than or equal to the repeat count in the TFORMn keyword.
This tests that this works if less than (treating the trailing bytes
as unspecified fill values per the FITS standard) and fails if the
dimensions specified by TDIMn are greater than the repeat count.'

def test_mismatched_tform_and_tdim(self):

    arra = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])
    arrb = np.array([[[9, 10], [11, 12]], [[13, 14], [15, 16]]])
    cols = [fits.Column(name='a', format='20I', dim='(2,2)', array=arra), fits.Column(name='b', format='4I', dim='(2,2)', array=arrb)]
    hdu = fits.BinTableHDU.from_columns(fits.ColDefs(cols))
    hdu.writeto(self.temp('test.fits'))
    with fits.open(self.temp('test.fits')) as h:
        assert (h[1].header['TFORM1'] == '20I')
        assert (h[1].header['TFORM2'] == '4I')
        assert (h[1].header['TDIM1'] == h[1].header['TDIM2'] == '(2,2)')
        assert (h[1].data['a'] == arra).all()
        assert (h[1].data['b'] == arrb).all()
        assert (h[1].data.itemsize == 48)
    pytest.raises(VerifyError, fits.Column, name='a', format='2I', dim='(2,2)', array=arra)
