Ejemplo n.º 1
0
    def test_dataless2resp(self):
        with TemporaryWorkingDirectory():
            with CatchOutput() as out:
                obspy_dataless2resp([self.dataless_file])

            expected = '''Found 1 files.
Parsing file %s
''' % (self.dataless_file,)
            self.assertEqual(expected.encode('utf-8'), out.stdout)

            expected = ['RESP.BW.FURT..EHE',
                        'RESP.BW.FURT..EHN',
                        'RESP.BW.FURT..EHZ']
            actual = sorted(os.listdir(os.curdir))
            self.assertEqual(expected, actual)
Ejemplo n.º 2
0
    def test_dataless2resp(self):
        with TemporaryWorkingDirectory():
            with CatchOutput() as out:
                obspy_dataless2resp([self.dataless_file])

            expected = '''Found 1 files.
Parsing file %s
''' % (self.dataless_file, )
            self.assertEqual(expected.encode('utf-8'), out.stdout)

            expected = [
                'RESP.BW.FURT..EHE', 'RESP.BW.FURT..EHN', 'RESP.BW.FURT..EHZ'
            ]
            actual = sorted(os.listdir(os.curdir))
            self.assertEqual(expected, actual)
Ejemplo n.º 3
0
    def test_dataless2resp_zipped(self):
        with TemporaryWorkingDirectory():
            with CatchOutput() as out:
                obspy_dataless2resp(['--zipped', self.dataless_file])

            expected = '''Found 1 files.
Parsing file %s
''' % (self.dataless_file,)
            self.assertEqual(expected.encode('utf-8'), out.stdout)

            self.assertTrue(os.path.exists('dataless.seed.BW_FURT.zip'))

            expected = ['RESP.BW.FURT..EHE',
                        'RESP.BW.FURT..EHN',
                        'RESP.BW.FURT..EHZ']
            zf = zipfile.ZipFile('dataless.seed.BW_FURT.zip')
            actual = sorted(zf.namelist())
            zf.close()
            self.assertEqual(expected, actual)
Ejemplo n.º 4
0
    def test_dataless2resp_zipped(self):
        with TemporaryWorkingDirectory():
            with CatchOutput() as out:
                obspy_dataless2resp(['--zipped', self.dataless_file])

            expected = '''Found 1 files.
Parsing file %s
''' % (self.dataless_file, )
            self.assertEqual(expected.encode('utf-8'), out.stdout)

            self.assertTrue(os.path.exists('dataless.seed.BW_FURT.zip'))

            expected = [
                'RESP.BW.FURT..EHE', 'RESP.BW.FURT..EHN', 'RESP.BW.FURT..EHZ'
            ]
            zf = zipfile.ZipFile('dataless.seed.BW_FURT.zip')
            actual = sorted(zf.namelist())
            zf.close()
            self.assertEqual(expected, actual)