Exemplo n.º 1
0
    def test_invalid_character(self):
        reader = get_mock_reader([
            b"<METING>22,999,152.401,444100.>055,2.206,2.206</METING>\n"
        ])

        parser.parse_meting(reader)

        self.assertFalse(reader.success)
Exemplo n.º 2
0
    def test_x_is_not_a_valid_float(self):
        reader = get_mock_reader([
            b"<METING>22,999,152.168.401,444100.055,2.206,2.206</METING>\n"
        ])

        parser.parse_meting(reader)

        self.assertFalse(reader.success)
Exemplo n.º 3
0
    def test_missing_bekleding_code(self):
        """What if we remove the 999. Issue #69 says that that does
        not result in an error."""
        reader = get_mock_reader([
            b"<METING>22,,152168.401,444100.055,2.206,2.206</METING>\n"
        ])

        parser.parse_meting(reader)

        self.assertFalse(reader.success)
Exemplo n.º 4
0
    def test_numbers_converted_to_float(self):
        reader = get_mock_reader([
            b"<METING>22,999,152168.401,444100.055,2.206,2.206</METING>\n"
        ])

        meting = parser.parse_meting(reader)

        self.assertTrue(reader.success)
        self.assertTrue(meting)
        self.assertTrue(isinstance(meting.x, float))
        self.assertTrue(isinstance(meting.y, float))
        self.assertTrue(isinstance(meting.z1, float))
        self.assertTrue(isinstance(meting.z2, float))