def test_this_example_appears_to_loop_forever(self): reader = get_mock_reader([ b"<PROFIEL>W81-2_1,Profiel_1,20130114,0,NAP,ABS,2,XY,112372.752,485955.504,\n", b"METING>1,999,112372.752,485955.504,-4.255,-4.255</METING>\n", b"<METING>22,999,112373.939,485957.095,-5.824,-5.824</METING>\n", b"<METING>5,999,112373.945,485957.103,-5.874,-5.844</METING>\n", b"<METING>5,999,112374.248,485957.488,-6.044,-5.984</METING>\n", b"<METING>5,999,112374.557,485957.881,-6.154,-6.084</METING>\n", b"<METING>22,999,112378.091,485962.366,-5.824,-5.824</METING>\n", b"<METING>2,999,112378.509,485962.92,-5.241,-5.241</METING>\n", b"</PROFIEL>\n" ]) parser.parse_profile(reader) self.assertEquals(reader.line_number, 10)
def test_invalid_characters_in_profiel(self): reader = get_mock_reader([ b"<PROFIEL>W81-2_1,Profiel_1,20130114,0,NA>P,ABS,2,XY,112372.752,485955.504,\n", b"<METING>2,999,15.0,15.0,-5.241,-5.241</METING>\n", b"<METING>1,999,-5.0,-5.0,-4.255,-4.255</METING>\n", b"<METING>22,999,0.0,00,-5.824,-5.824</METING>\n", b"<METING>22,999,10.0,10.0,-5.824,-5.824</METING>\n", b"<METING>5,999,2.0,2.>0,-5.874,-5.844</METING>\n", b"<METING>5,999,4.0,4.0,-6.044,-5.984</METING>\n", b"<METING>5,999,7.0,7.0,-6.084,-6.02</METING>\n", b"</PROFIEL>\n" ]) parser.parse_profile(reader) self.assertFalse(reader.success)
def test_invalid_characters_in_meting(self): reader = get_mock_reader([ b"<PROFIEL>W81-2_1,Profiel_1,20130114,0,NAP,ABS,2,XY,112372.752,485955.504,\n", b"<METING>2,999,15.0,15.0,-5.241,-5.241</METING>\n", b"<METING>1,999,-5.0,-5.0,-4.255,-4.255</METING>\n", b"<METING>22,999,0.0,00,-5.824,-5.824</METING>\n", b"<METING>22,999,10.0,10.0,-5.824,-5.824</METING>\n", b"<METING>5,999,2.0,2.>0,-5.874,-5.844</METING>\n", b"<METING>5,999,4.0,4.0,-6.044,-5.984</METING>\n", b"<METING>5,999,7.0,7.0,-6.084,-6.02</METING>\n", b"</PROFIEL>\n" ]) profile = parser.parse_profile(reader) sorted_measurements = profile.sorted_measurements self.assertEquals(len(sorted_measurements), 6) self.assertEquals(sorted_measurements[0].profile_point_type, '1') self.assertEquals(sorted_measurements[-1].profile_point_type, '2')