def test_streaming_hdu_file_wrong_mode(self):

        # touch new.fits
        with open(self.temp('new.fits'), 'wb'):
            pass

        with open(self.temp('new.fits'), 'rb') as f:
            header = fits.Header()
            assert_raises(ValueError, fits.StreamingHDU, f, header)
Test that streaming an HDU to a file opened in the wrong mode fails as
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/tests/test_core.py/TestStreamingFunctions.test_streaming_hdu_file_wrong_mode