'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/130
Ensures that opening a random groups file in update mode or writing it
to a new file does not cause any change to the parameter names.'

def test_parnames_round_trip(self):

    self.copy_file('random_groups.fits')
    parameters = ['UU', 'VV', 'WW', 'BASELINE', 'DATE']
    with fits.open(self.temp('random_groups.fits'), mode='update') as h:
        assert (h[0].parnames == parameters)
        h.flush()
    with fits.open(self.temp('random_groups.fits')) as h:
        assert (h[0].parnames == parameters)
        h.writeto(self.temp('test.fits'))
    with fits.open(self.temp('test.fits')) as h:
        assert (h[0].parnames == parameters)
