def setUpClass(cls): cls.ctd_sk = StreamKey('CE04OSPS', 'SF01B', '2A-CTDPFA107', 'streamed', 'ctdpf_sbe43_sample') cls.nut_sk = StreamKey('CE04OSPS', 'SF01B', '4A-NUTNRA102', 'streamed', 'nutnr_a_sample') cls.echo_sk = StreamKey('RS01SLBS', 'LJ01A', '05-HPIESA101', 'streamed', 'echo_sounding') cls.hourly_sk = StreamKey('GI01SUMO', 'SBD11', '06-METBKA000', 'recovered_host', 'metbk_hourly') cls.met_sk = StreamKey('GI01SUMO', 'SBD11', '06-METBKA000', 'recovered_host', 'metbk_a_dcl_instrument_recovered') cls.vel_sk = StreamKey('GI01SUMO', 'RID16', '04-VELPTA000', 'recovered_host', 'velpt_ab_dcl_instrument_recovered') cls.vel_sk2 = StreamKey('GI01SUMO', 'RID16', '04-VELPTA000', 'recovered_host', 'velpt_ab_dcl_diagnostics_recovered') cls.dosta_sk = StreamKey('CE02SHSP', 'SP001', '01-DOSTAJ000', 'recovered_cspp', 'dosta_abcdjm_cspp_instrument_recovered') cls.nut_sk2 = StreamKey('CE02SHSP', 'SP001', '05-NUTNRJ000', 'recovered_cspp', 'nutnr_j_cspp_instrument_recovered') cls.ctd_sk2 = StreamKey('CE02SHSP', 'SP001', '08-CTDPFJ000', 'recovered_cspp', 'ctdpf_j_cspp_instrument_recovered') cls.ctd_events = AssetEvents( cls.ctd_sk.as_three_part_refdes(), json.load( open( os.path.join(DATA_DIR, 'CE04OSPS-SF01B-2A-CTDPFA107_events.json')))) cls.nut_events = AssetEvents( cls.nut_sk.as_three_part_refdes(), json.load( open( os.path.join(DATA_DIR, 'CE04OSPS-SF01B-4A-NUTNRA102_events.json')))) cls.hpies_events = AssetEvents( cls.echo_sk.as_three_part_refdes(), json.load( open( os.path.join(DATA_DIR, 'RS01SLBS-LJ01A-05-HPIESA101_events.json')))) cls.met_events = AssetEvents( cls.met_sk.as_three_part_refdes(), json.load( open( os.path.join(DATA_DIR, 'GI01SUMO-SBD11-06-METBKA000_events.json')))) cls.vel_events = AssetEvents( cls.vel_sk.as_three_part_refdes(), json.load( open( os.path.join(DATA_DIR, 'GI01SUMO-RID16-04-VELPTA000_events.json'))))
def mock_fetch_raw_data(self): if StreamRequestTest.call_cnt % 2 == 0: self.datasets[self.stream_key] = StreamDataset(self.stream_key, self.uflags, [], self.request_id) self.datasets[self.stream_key]._insert_dataset(ctd_ds) self.datasets[self.stream_key].events = AssetEvents('test', []) else: self.datasets[self.stream_key] = StreamDataset(self.stream_key, self.uflags, [], self.request_id) self.datasets[self.stream_key]._insert_dataset(echo_ds) self.datasets[self.stream_key].events = AssetEvents('test', []) StreamRequestTest.call_cnt += 1
def setUpClass(cls): cls.nutnr_sk = StreamKey('CE04OSPS', 'SF01B', '4A-NUTNRA102', 'streamed', 'nutnr_a_sample') cls.ctdpf_sk = StreamKey('CE04OSPS', 'SF01B', '2A-CTDPFA107', 'streamed', 'ctdpf_sbe43_sample') cls.metbk_sk = StreamKey('CE02SHSM', 'SBD11', '06-METBKA000', 'telemetered', 'metbk_a_dcl_instrument') cls.velpt_sk = StreamKey('CE02SHSM', 'SBD11', '04-VELPTA000', 'telemetered', 'velpt_ab_dcl_instrument') cls.nutnr_fn = 'nutnr_a_sample.nc' cls.ctdpf_fn = 'ctdpf_sbe43_sample.nc' cls.metbk_fn = 'metbk_a_dcl_instrument.nc' cls.velpt_fn = 'velpt_ab_dcl_instrument.nc' cls.ctd_events = AssetEvents(cls.ctdpf_sk.as_three_part_refdes(), json.load(open(os.path.join(DATA_DIR, 'CE04OSPS-SF01B-2A-CTDPFA107_events.json')))) cls.nut_events = AssetEvents(cls.nutnr_sk.as_three_part_refdes(), json.load(open(os.path.join(DATA_DIR, 'CE04OSPS-SF01B-4A-NUTNRA102_events.json')))) cls.velpt_events = AssetEvents(cls.velpt_sk.as_three_part_refdes(), json.load(open(os.path.join(DATA_DIR, 'CE02SHSM-SBD11-04-VELPTA000_events.json')))) cls.metbk_events = AssetEvents(cls.metbk_sk.as_three_part_refdes(), json.load(open(os.path.join(DATA_DIR, 'CE02SHSM-SBD11-06-METBKA000_events.json'))))
def setUpClass(cls): cls.ctd_sk = StreamKey('CE04OSPS', 'SF01B', '2A-CTDPFA107', 'streamed', 'ctdpf_sbe43_sample') cls.nut_sk = StreamKey('CE04OSPS', 'SF01B', '4A-NUTNRA102', 'streamed', 'nutnr_a_sample') cls.ctd_events = AssetEvents( cls.ctd_sk.as_three_part_refdes(), json.load( open( os.path.join(DATA_DIR, 'CE04OSPS-SF01B-2A-CTDPFA107_events.json')))) cls.nut_events = AssetEvents( cls.nut_sk.as_three_part_refdes(), json.load( open( os.path.join(DATA_DIR, 'CE04OSPS-SF01B-4A-NUTNRA102_events.json')))) cls.base_params = ['time', 'deployment', 'provenance'] cls.qartod_find_url = '/'.join((qartodTestServiceAPI.base_url, 'find'))
def get_events(self, stream_key): return AssetEvents(stream_key.as_three_part_refdes(), {})