def test_checksum_fails(self): p = GPGSA() p.checksum = '38' p.nmea_sentence = "$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*38" result = p.check_chksum() self.assertFalse(result)
def test_checksum_passes(self): p = GPGSA() p.checksum = '39' p.nmea_sentence = "$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39" result = p.check_chksum() self.assertTrue(result)
def test_parses_map(self): p = GPGSA() p.parse("$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39") self.assertEqual("GPGSA", p.sen_type) self.assertEqual("A", p.mode) self.assertEqual("3", p.mode_fix_type) self.assertEqual("04", p.sv_id01) self.assertEqual("05", p.sv_id02) self.assertEqual("", p.sv_id03) self.assertEqual("09", p.sv_id04) self.assertEqual("12", p.sv_id05) self.assertEqual("", p.sv_id06) self.assertEqual("", p.sv_id07) self.assertEqual("24", p.sv_id08) self.assertEqual("", p.sv_id09) self.assertEqual("", p.sv_id10) self.assertEqual("", p.sv_id11) self.assertEqual("", p.sv_id12) self.assertEqual("2.5", p.pdop) self.assertEqual("1.3", p.hdop) self.assertEqual("2.1", p.vdop) self.assertEqual("39", p.checksum)
def test_parses_map(self): p = GPGSA() p.parse("$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39") self.assertEquals("GPGSA", p.sen_type) self.assertEquals("A", p.mode) self.assertEquals("3", p.mode_fix_type) self.assertEquals("04", p.sv_id01) self.assertEquals("05", p.sv_id02) self.assertEquals("", p.sv_id03) self.assertEquals("09", p.sv_id04) self.assertEquals("12", p.sv_id05) self.assertEquals("", p.sv_id06) self.assertEquals("", p.sv_id07) self.assertEquals("24", p.sv_id08) self.assertEquals("", p.sv_id09) self.assertEquals("", p.sv_id10) self.assertEquals("", p.sv_id11) self.assertEquals("", p.sv_id12) self.assertEquals("2.5", p.pdop) self.assertEquals("1.3", p.hdop) self.assertEquals("2.1", p.vdop) self.assertEquals("39", p.checksum)