コード例 #1
0
ファイル: test_zmap.py プロジェクト: rpratt20/obspy
 def test_read(self):
     # via file, file name, plugin interface
     test_events = [self.test_data, dict(self.test_data, lon='5.1')]
     zmap_str = self._serialize((test_events))
     with NamedTemporaryFile() as f:
         f.write(zmap_str.encode('utf-8'))
         catalog = zmap._read_zmap(f.name)
         self._assert_zmap_equal(catalog, test_events)
         f.seek(0)
         catalog = zmap._read_zmap(f)
         self._assert_zmap_equal(catalog, test_events)
         catalog = read_events(f.name)
         self._assert_zmap_equal(catalog, test_events)
     # direct ZMAP string
     catalog = zmap._read_zmap(zmap_str)
     self._assert_zmap_equal(catalog, test_events)
コード例 #2
0
ファイル: test_zmap.py プロジェクト: jmfee-usgs/obspy
 def test_read(self):
     # via file, file name, plugin interface
     test_events = [self.test_data, dict(self.test_data, lon='5.1')]
     zmap_str = self._serialize((test_events))
     with NamedTemporaryFile() as f:
         f.write(zmap_str.encode('utf-8'))
         catalog = zmap._read_zmap(f.name)
         self._assert_zmap_equal(catalog, test_events)
         f.seek(0)
         catalog = zmap._read_zmap(f)
         self._assert_zmap_equal(catalog, test_events)
         catalog = read_events(f.name)
         self._assert_zmap_equal(catalog, test_events)
     # direct ZMAP string
     catalog = zmap._read_zmap(zmap_str)
     self._assert_zmap_equal(catalog, test_events)
コード例 #3
0
ファイル: test_zmap.py プロジェクト: zurgeg/obspy
 def test_read_float_seconds(self):
     """
     Test that floating point part of seconds is parsed correctly.
     """
     catalog = zmap._read_zmap(os.path.join(self.data_dir, "templates.txt"))
     self.assertEqual(catalog[0].origins[0].time.microsecond, 840000)
     self.assertEqual(catalog[1].origins[0].time.microsecond, 880000)
     self.assertEqual(catalog[2].origins[0].time.microsecond, 550000)
     self.assertEqual(catalog[3].origins[0].time.microsecond, 450000)
コード例 #4
0
ファイル: test_zmap.py プロジェクト: obspy/obspy
 def test_read_float_seconds(self):
     """
     Test that floating point part of seconds is parsed correctly.
     """
     catalog = zmap._read_zmap(os.path.join(self.data_dir, "templates.txt"))
     self.assertEqual(catalog[0].origins[0].time.microsecond, 840000)
     self.assertEqual(catalog[1].origins[0].time.microsecond, 880000)
     self.assertEqual(catalog[2].origins[0].time.microsecond, 550000)
     self.assertEqual(catalog[3].origins[0].time.microsecond, 450000)