@@ -0,0 +1,1713 @@
+from tsparser.parser import imu%0Afrom tsparser.tests.parser import ParserTestCase, DEFAULT_TIMESTAMP%0A%0A%0Aclass TestIMU(ParserTestCase):%0A    ex_data = %7B'timestamp': DEFAULT_TIMESTAMP, 'pressure': 3981106,%0A               'gyro_x': -413, 'gyro_y': -1286, 'gyro_z': -2545,%0A               'accel_x': 14400, 'accel_y': 3328, 'accel_z': 5440,%0A               'magnet_x': 13310, 'magnet_y': -32001, 'magnet_z': 5118%7D%0A    lines = %5B'$GYRO,-413,-1286,-2545', '$ACCEL,14400,3328,5440',%0A             '$MAGNET,13310,-32001,5118', '$MBAR,3981106'%5D%0A%0A    def test_imu_parser(self):%0A        %22%22%22Test IMUParser with standard output%22%22%22%0A        for line in self.lines%5B:3%5D:%0A            self.parse_line(line)%0A        self.assertEqual(self.send_data_mock.called, False)%0A        self.parse_line(self.lines%5B3%5D)%0A        self.send_data_mock.assert_called_with(self.ex_data, imu.IMUParser.url)%0A%0A    def test_imu_parser_different_order(self):%0A        %22%22%22Test IMUParser with input in different order%22%22%22%0A        self.parse_line(self.lines%5B1%5D)%0A        self.parse_line(self.lines%5B3%5D)%0A        self.parse_line(self.lines%5B2%5D)%0A        self.assertEqual(self.send_data_mock.called, False)%0A        self.parse_line(self.lines%5B0%5D)%0A        self.send_data_mock.assert_called_with(self.ex_data, imu.IMUParser.url)%0A%0A    def test_imu_parser_invalid_data(self):%0A        %22%22%22Test IMUParser with invalid input%22%22%22%0A        self.assertRaises(ValueError, self.parse_line, '$GYRO,111')%0A        self.assertRaises(ValueError, self.parse_line, '$GYRO,a,b,c')%0A        self.assertRaises(ValueError, self.parse_line, '$ACCEL,111,-1,222,4')%0A        self.assertRaises(ValueError, self.parse_line, '$MAGNET,82,222')%0A        self.assertRaises(ValueError, self.parse_line, '$MBAR,1,2')%0A

Add unit tests to IMUParser