diff --git a/aosstower/tests/l00/test_parser.py b/aosstower/tests/l00/test_parser.py index c7e9b7647924a36388f456bb3b1016caa6165106..1424f1061e3560ddcec8987a4243685e3bc5bf04 100644 --- a/aosstower/tests/l00/test_parser.py +++ b/aosstower/tests/l00/test_parser.py @@ -31,15 +31,15 @@ class ParserV0Tests(unittest.TestCase): self.assertEqual(record['stamp'], datetime(1970, 1, 1)) -class ParserV1Tests(unittest.TestCase): +class ParserV1V2Tests(unittest.TestCase): line = ("1,1970,1,0000,0,976.59,5.8564,30.085,25.893,977.36,58732," "47.375,24.234,23.865,22.615,37.219,6.9222,67.398,145.2,45.581," "22.669,10.417,145.2,22.665,163.94,0,0,30.015,29.89\n") def _cut(self): - from aosstower.l00.parser import ParserV1 - return ParserV1() + from aosstower.l00.parser import ParserV1V2 + return ParserV1V2() def test_maybe_mine(self): parser = self._cut() @@ -56,3 +56,8 @@ class ParserV1Tests(unittest.TestCase): self.assertIn('stamp', record) self.assertEqual(record['stamp'], datetime(1970, 1, 1)) + def test_record_supports_v1_and_v2(self): + parser = self._cut() + + parser.parse(self.line) + parser.parse(self.line.strip() + ',999\n')