def test_read_and_write_multi_channel_asc_file(self): """ Read and write ASC file via obspy.io.sh.core._read_asc. """ origfile = os.path.join(self.path, 'data', 'QFILE-TEST-ASC.ASC') # read original stream1 = _read_asc(origfile) stream1.verify() self._compare_stream(stream1) # write with NamedTemporaryFile() as tf: tempfile = tf.name _write_asc(stream1, tempfile, STANDARD_ASC_HEADERS + ['COMMENT']) # read both files and compare the content with open(origfile, 'rt') as f: text1 = f.readlines() with open(tempfile, 'rt') as f: text2 = f.readlines() self.assertEqual(text1, text2) # read again stream2 = _read_asc(tempfile) stream2.verify() self._compare_stream(stream2)
def test_readAndWriteMultiChannelASCFile(self): """ Read and write ASC file via obspy.io.sh.core._read_asc. """ origfile = os.path.join(self.path, 'data', 'QFILE-TEST-ASC.ASC') # read original stream1 = _read_asc(origfile) stream1.verify() self._compareStream(stream1) # write with NamedTemporaryFile() as tf: tempfile = tf.name _write_asc(stream1, tempfile, STANDARD_ASC_HEADERS + ['COMMENT']) # read both files and compare the content with open(origfile, 'rt') as f: text1 = f.readlines() with open(tempfile, 'rt') as f: text2 = f.readlines() self.assertEqual(text1, text2) # read again stream2 = _read_asc(tempfile) stream2.verify() self._compareStream(stream2)