'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/56
(BZERO and BSCALE added in the wrong location when appending scaled
data)'

def test_append_uint_data(self):

    fits.writeto(self.temp('test_new.fits'), data=np.array([], dtype='uint8'))
    d = np.zeros([100, 100]).astype('uint16')
    fits.append(self.temp('test_new.fits'), data=d)
    f = fits.open(self.temp('test_new.fits'), uint=True)
    assert (f[1].data.dtype == 'uint16')
