コード例 #1
0
ファイル: test_auv_eng_auv.py プロジェクト: GrimJ/mi-dataset
    def test_simple_usbl(self):
        """
        Read test data and pull out data particles.
        Assert that the results are those we expected.
        """

        with open(os.path.join(RESOURCE_PATH, 'subset_usbl.csv'), 'rU') as stream_handle:

            # test the telemetered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            particles = parser.get_records(25)

            self.assert_particles(particles, 'usbl_telem_22.yml', RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])

        with open(os.path.join(RESOURCE_PATH, 'subset_usbl.csv'), 'rU') as stream_handle:

            # test the telemetered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=False)

            particles = parser.get_records(25)

            self.assert_particles(particles, 'usbl_recov_22.yml', RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])
コード例 #2
0
ファイル: test_auv_eng_auv.py プロジェクト: GrimJ/mi-dataset
    def test_get_many(self):
        """
        Read test data and pull out data particles.
        Assert that the results are those we expected.
        This test parses a file containing all message types and verifies
        all of the engineering data messages
        """

        with open(os.path.join(RESOURCE_PATH, 'subset2_reduced.csv'), 'rU') as stream_handle:

            # test the telemetered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            particles = parser.get_records(200)

            self.assert_particles(particles, 'subset2_reduced_telem.yml', RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])

        with open(os.path.join(RESOURCE_PATH, 'subset2_reduced.csv'), 'rU') as stream_handle:

            # test the recovered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=False)

            particles = parser.get_records(200)

            self.assert_particles(particles, 'subset2_reduced_recov.yml', RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])
コード例 #3
0
    def _build_parser(self, stream_handle):

        parser = AuvEngAuvParser(stream_handle,
                                 self._exception_callback,
                                 is_telemetered=True)

        return parser
コード例 #4
0
ファイル: test_auv_eng_auv.py プロジェクト: GrimJ/mi-dataset
    def test_bad_timestamp_fault(self):
        """
        Read test data and pull out data particles.
        Assert the expected we get 1 errors due to incorrect epoch and mission time formats
        This tests the generic timestamp method with two parameters
        """

        with open(os.path.join(RESOURCE_PATH, 'fault_bad_timestamp.csv'), 'rU') as stream_handle:
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            particles = parser.get_records(10)  # ask for 10 should get 5

            self.assertEqual(len(particles), 5)
            self.assertEqual(len(self.exception_callback_value), 1)
            self.assertIsInstance(self.exception_callback_value[0], RecoverableSampleException)
コード例 #5
0
ファイル: test_auv_eng_auv.py プロジェクト: GrimJ/mi-dataset
    def test_long_stream(self):
        """
        Read test data and pull out data particles.
        Assert that the results are those we expected.
        This test parses a very large file containing all message types and verifies
        there are no errors
        """

        with open(os.path.join(RESOURCE_PATH, 'subset2.csv'), 'rU') as stream_handle:

            # test the telemetered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            parser.get_records(160000)

            self.assertEqual(self.exception_callback_value, [])
コード例 #6
0
    def test_long_stream(self):
        """
        Read test data and pull out data particles.
        Assert that the results are those we expected.
        This test parses a very large file containing all message types and verifies
        there are no errors
        """

        with open(os.path.join(RESOURCE_PATH, 'subset2.csv'),
                  'rU') as stream_handle:

            # test the telemetered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            parser.get_records(160000)

            self.assertEqual(self.exception_callback_value, [])
コード例 #7
0
    def test_bad_timestamp_fault(self):
        """
        Read test data and pull out data particles.
        Assert the expected we get 1 errors due to incorrect epoch and mission time formats
        This tests the generic timestamp method with two parameters
        """

        with open(os.path.join(RESOURCE_PATH, 'fault_bad_timestamp.csv'),
                  'rU') as stream_handle:
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            particles = parser.get_records(10)  # ask for 10 should get 5

            self.assertEqual(len(particles), 5)
            self.assertEqual(len(self.exception_callback_value), 1)
            self.assertIsInstance(self.exception_callback_value[0],
                                  RecoverableSampleException)
コード例 #8
0
ファイル: test_auv_eng_auv.py プロジェクト: GrimJ/mi-dataset
    def test_bad_timestamp_state(self):
        """
        Read test data and pull out data particles.
        Assert the expected we get 1 errors due to incorrect epoch and mission time formats
        This tests the generic timestamp method with two parameters
        """

        # TODO the Mission time in this block looks to be way to big,  waiting to hear from Hydroid
        with open(os.path.join(RESOURCE_PATH, 'state_bad_timestamps.csv'), 'rU') as stream_handle:
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            particles = parser.get_records(10)  # ask for 10 should get 6

            self.assertEqual(len(particles), 6)
            self.assertEqual(len(self.exception_callback_value), 2)
            self.assertIsInstance(self.exception_callback_value[0], RecoverableSampleException)
            self.assertIsInstance(self.exception_callback_value[1], RecoverableSampleException)
コード例 #9
0
    def test_simple_usbl(self):
        """
        Read test data and pull out data particles.
        Assert that the results are those we expected.
        """

        with open(os.path.join(RESOURCE_PATH, 'subset_usbl.csv'),
                  'rU') as stream_handle:

            # test the telemetered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            particles = parser.get_records(25)

            self.assert_particles(particles, 'usbl_telem_22.yml',
                                  RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])

        with open(os.path.join(RESOURCE_PATH, 'subset_usbl.csv'),
                  'rU') as stream_handle:

            # test the telemetered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=False)

            particles = parser.get_records(25)

            self.assert_particles(particles, 'usbl_recov_22.yml',
                                  RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])
コード例 #10
0
    def test_bad_timestamp_state(self):
        """
        Read test data and pull out data particles.
        Assert the expected we get 1 errors due to incorrect epoch and mission time formats
        This tests the generic timestamp method with two parameters
        """

        # TODO the Mission time in this block looks to be way to big,  waiting to hear from Hydroid
        with open(os.path.join(RESOURCE_PATH, 'state_bad_timestamps.csv'),
                  'rU') as stream_handle:
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            particles = parser.get_records(10)  # ask for 10 should get 6

            self.assertEqual(len(particles), 6)
            self.assertEqual(len(self.exception_callback_value), 2)
            self.assertIsInstance(self.exception_callback_value[0],
                                  RecoverableSampleException)
            self.assertIsInstance(self.exception_callback_value[1],
                                  RecoverableSampleException)
コード例 #11
0
    def test_get_many(self):
        """
        Read test data and pull out data particles.
        Assert that the results are those we expected.
        This test parses a file containing all message types and verifies
        all of the engineering data messages
        """

        with open(os.path.join(RESOURCE_PATH, 'subset2_reduced.csv'),
                  'rU') as stream_handle:

            # test the telemetered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=True)

            particles = parser.get_records(200)

            self.assert_particles(particles, 'subset2_reduced_telem.yml',
                                  RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])

        with open(os.path.join(RESOURCE_PATH, 'subset2_reduced.csv'),
                  'rU') as stream_handle:

            # test the recovered particle stream
            parser = AuvEngAuvParser(stream_handle,
                                     self.exception_callback,
                                     is_telemetered=False)

            particles = parser.get_records(200)

            self.assert_particles(particles, 'subset2_reduced_recov.yml',
                                  RESOURCE_PATH)

            self.assertEqual(self.exception_callback_value, [])