'Test reading and writing a file with a colon in the filename.
Regression test for https://github.com/astropy/astropy/issues/3122'

@pytest.mark.skipif(str('sys.platform.startswith("win32")'))
def test_filename_with_colon(self):

    filename = 'APEXHET.2014-04-01T15:18:01.000.fits'
    hdu = fits.PrimaryHDU(data=np.arange(10))
    hdu.writeto(self.temp(filename))
    with fits.open(self.temp(filename)) as hdul:
        assert np.all((hdul[0].data == hdu.data))
