'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/171
Tests that data containing more than two dimensions can be
compressed with HCOMPRESS_1 so long as the user-supplied tile size can
be flattened to two dimensions.'

@ignore_warnings(AstropyPendingDeprecationWarning)
def test_comp_image_hcompress_image_stack(self):

    cube = np.arange(300, dtype=np.float32).reshape((3, 10, 10))
    hdu = fits.CompImageHDU(data=cube, name='SCI', compressionType='HCOMPRESS_1', quantizeLevel=16, tileSize=[5, 5, 1])
    hdu.writeto(self.temp('test.fits'))
    with fits.open(self.temp('test.fits')) as hdul:
        assert (np.abs((hdul['SCI'].data - cube)).max() < (1.0 / 15.0))
