def test_parses_map(self): p = GPGSV() p.parse("$GPGSV,3,1,11,03,03,111,00,04,15,270,00,06,01,010,00,13,06,292,00*74") self.assertEqual("GPGSV", p.sen_type) self.assertEqual('3', p.num_messages) self.assertEqual('1', p.msg_num) self.assertEqual('11', p.num_sv_in_view) self.assertEqual('03', p.sv_prn_num_1) self.assertEqual('03', p.elevation_deg_1) self.assertEqual('111', p.azimuth_1) self.assertEqual('00', p.snr_1) self.assertEqual('04', p.sv_prn_num_2) self.assertEqual('15', p.elevation_deg_2) self.assertEqual('270', p.azimuth_2) self.assertEqual('00', p.snr_2) self.assertEqual('06', p.sv_prn_num_3) self.assertEqual('01', p.elevation_deg_3) self.assertEqual('010', p.azimuth_3) self.assertEqual('00', p.snr_3) self.assertEqual('13', p.sv_prn_num_4) self.assertEqual('06', p.elevation_deg_4) self.assertEqual('292', p.azimuth_4) self.assertEqual('00', p.snr_4) self.assertEqual("74", p.checksum)
def test_parses_map(self): p = GPGSV() p.parse( "$GPGSV,3,1,11,03,03,111,00,04,15,270,00,06,01,010,00,13,06,292,00*74" ) self.assertEquals("GPGSV", p.sen_type) self.assertEquals('3', p.num_messages) self.assertEquals('1', p.msg_num) self.assertEquals('11', p.num_sv_in_view) self.assertEquals('03', p.sv_prn_num_1) self.assertEquals('03', p.elevation_deg_1) self.assertEquals('111', p.azimuth_1) self.assertEquals('00', p.snr_1) self.assertEquals('04', p.sv_prn_num_2) self.assertEquals('15', p.elevation_deg_2) self.assertEquals('270', p.azimuth_2) self.assertEquals('00', p.snr_2) self.assertEquals('06', p.sv_prn_num_3) self.assertEquals('01', p.elevation_deg_3) self.assertEquals('010', p.azimuth_3) self.assertEquals('00', p.snr_3) self.assertEquals('13', p.sv_prn_num_4) self.assertEquals('06', p.elevation_deg_4) self.assertEquals('292', p.azimuth_4) self.assertEquals('00', p.snr_4) self.assertEquals("74", p.checksum)
def test_checksum_fails(self): p = GPGSV() p.checksum = '73' p.nmea_sentence = "$GPGSV,3,1,11,03,03,111,00,04,15,270,00,06,01,010,00,13,06,292,00*74" result = p.check_chksum() self.assertFalse(result)