def test_selectDoesNotChangeTheParserFormat(self): """ Test that using the _select() method of the Parser object does not change the _format attribute. """ p = Parser(os.path.join(self.path, "dataless.seed.BW_FURT.xml")) self.assertEqual(p._format, "XSEED") p._select(p.get_inventory()["channels"][0]["channel_id"]) self.assertEqual(p._format, "XSEED")
def test_select_does_not_change_the_parser_format(self): """ Test that using the _select() method of the Parser object does not change the _format attribute. """ p = Parser(os.path.join(self.path, "dataless.seed.BW_FURT.xml")) self.assertEqual(p._format, "XSEED") p._select(p.get_inventory()["channels"][0]["channel_id"]) self.assertEqual(p._format, "XSEED")
def test_get_inventory(self): """ Tests the parser's get_inventory() method. """ filename = os.path.join(self.path, 'dataless.seed.BW_FURT') p = Parser(filename) self.assertEqual( p.get_inventory(), { 'networks': [{ 'network_code': 'BW', 'network_name': 'BayernNetz' }], 'stations': [{ 'station_name': 'Furstenfeldbruck, Bavaria, BW-Net', 'station_id': 'BW.FURT' }], 'channels': [{ 'channel_id': 'BW.FURT..EHZ', 'start_date': UTCDateTime(2001, 1, 1, 0, 0), 'instrument': 'Lennartz LE-3D/1 seismometer', 'elevation_in_m': 565.0, 'latitude': 48.162899, 'local_depth_in_m': 0.0, 'longitude': 11.2752, 'end_date': '', 'sampling_rate': 200.0 }, { 'channel_id': 'BW.FURT..EHN', 'start_date': UTCDateTime(2001, 1, 1, 0, 0), 'instrument': 'Lennartz LE-3D/1 seismometer', 'elevation_in_m': 565.0, 'latitude': 48.162899, 'local_depth_in_m': 0.0, 'longitude': 11.2752, 'end_date': '', 'sampling_rate': 200.0 }, { 'channel_id': 'BW.FURT..EHE', 'start_date': UTCDateTime(2001, 1, 1, 0, 0), 'instrument': 'Lennartz LE-3D/1 seismometer', 'elevation_in_m': 565.0, 'latitude': 48.162899, 'local_depth_in_m': 0.0, 'longitude': 11.2752, 'end_date': '', 'sampling_rate': 200.0 }] })
def test_get_inventory(self): """ Tests the parser's get_inventory() method. """ filename = os.path.join(self.path, "dataless.seed.BW_FURT") p = Parser(filename) self.assertEqual( p.get_inventory(), { "networks": [{"network_code": "BW", "network_name": "BayernNetz"}], "stations": [{"station_name": "Furstenfeldbruck, Bavaria, BW-Net", "station_id": "BW.FURT"}], "channels": [ { "channel_id": "BW.FURT..EHZ", "start_date": UTCDateTime(2001, 1, 1, 0, 0), "instrument": "Lennartz LE-3D/1 seismometer", "elevation_in_m": 565.0, "latitude": 48.162899, "local_depth_in_m": 0.0, "longitude": 11.2752, "end_date": "", "sampling_rate": 200.0, }, { "channel_id": "BW.FURT..EHN", "start_date": UTCDateTime(2001, 1, 1, 0, 0), "instrument": "Lennartz LE-3D/1 seismometer", "elevation_in_m": 565.0, "latitude": 48.162899, "local_depth_in_m": 0.0, "longitude": 11.2752, "end_date": "", "sampling_rate": 200.0, }, { "channel_id": "BW.FURT..EHE", "start_date": UTCDateTime(2001, 1, 1, 0, 0), "instrument": "Lennartz LE-3D/1 seismometer", "elevation_in_m": 565.0, "latitude": 48.162899, "local_depth_in_m": 0.0, "longitude": 11.2752, "end_date": "", "sampling_rate": 200.0, }, ], }, )
def test_get_inventory(self): """ Tests the parser's get_inventory() method. """ filename = os.path.join(self.path, 'dataless.seed.BW_FURT') p = Parser(filename) self.assertEqual( p.get_inventory(), {'networks': [{'network_code': 'BW', 'network_name': 'BayernNetz'}], 'stations': [{'station_name': 'Furstenfeldbruck, Bavaria, BW-Net', 'station_id': 'BW.FURT'}], 'channels': [ {'channel_id': 'BW.FURT..EHZ', 'start_date': UTCDateTime(2001, 1, 1, 0, 0), 'instrument': 'Lennartz LE-3D/1 seismometer', 'elevation_in_m': 565.0, 'latitude': 48.162899, 'local_depth_in_m': 0.0, 'longitude': 11.2752, 'end_date': '', 'sampling_rate': 200.0}, {'channel_id': 'BW.FURT..EHN', 'start_date': UTCDateTime(2001, 1, 1, 0, 0), 'instrument': 'Lennartz LE-3D/1 seismometer', 'elevation_in_m': 565.0, 'latitude': 48.162899, 'local_depth_in_m': 0.0, 'longitude': 11.2752, 'end_date': '', 'sampling_rate': 200.0}, {'channel_id': 'BW.FURT..EHE', 'start_date': UTCDateTime(2001, 1, 1, 0, 0), 'instrument': 'Lennartz LE-3D/1 seismometer', 'elevation_in_m': 565.0, 'latitude': 48.162899, 'local_depth_in_m': 0.0, 'longitude': 11.2752, 'end_date': '', 'sampling_rate': 200.0}]})