def _build_parser(self, stream_handle): parser = ParadNAuvParser(stream_handle, self._exception_callback, is_telemetered=False) return parser
def test_long_stream_telem(self): """ Read test data and pull out data particles. Assert the expected number of particles is captured and there are no exceptions """ stream_handle = open(os.path.join(RESOURCE_PATH, 'subset.csv'), 'rU') parser = ParadNAuvParser(stream_handle, self.exception_callback, is_telemetered=True) particles = parser.get_records(5000) # there are over 77,000 samples in the file. 5000 should suffice! self.assertEqual(len(particles), 5000) self.assertEqual(self.exception_callback_value, []) stream_handle.close()
def test_simple_recov(self): """ Read test data and pull out data particles. Assert that the results are those we expected. Expect the first input record to be skipped due to invalid timestamp """ stream_handle = open(os.path.join(RESOURCE_PATH, 'subset_reduced.csv'), 'rU') parser = ParadNAuvParser(stream_handle, self.exception_callback, is_telemetered=False) particles = parser.get_records(22) self.assert_particles(particles, 'parad_n_auv_recov_22.yml', RESOURCE_PATH) self.assertEqual(self.exception_callback_value, []) stream_handle.close()