'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/77
(PyFITS doesn\'t preserve byte order of non-native order column arrays)'

def test_column_endianness(self):

    a = [1.0, 2.0, 3.0, 4.0]
    a1 = np.array(a, dtype='<f8')
    a2 = np.array(a, dtype='>f8')
    col1 = fits.Column(name='a', format='D', array=a1)
    col2 = fits.Column(name='b', format='D', array=a2)
    cols = fits.ColDefs([col1, col2])
    tbhdu = fits.BinTableHDU.from_columns(cols)
    assert (tbhdu.data['a'] == a1).all()
    assert (tbhdu.data['b'] == a2).all()
    tbhdu.writeto(self.temp('testendian.fits'), overwrite=True)
    with fits.open(self.temp('testendian.fits')) as hdul:
        assert (hdul[1].data['a'] == a2).all()
        assert (hdul[1].data['b'] == a2).all()
