def test_checksum_fails_wrong_str(self): parse_map = ('Checksum', 'checksum') nmea_str = "$GPGLL,3751.65,S,14507.36,W*77" p = NMEASentence(parse_map) p.checksum = '77' p.nmea_sentence = nmea_str result = p.check_chksum() self.assertFalse(result)
def test_checksum_passes(self): parse_map = ('Checksum', 'checksum') nmea_str = "$GPGLL,3751.65,S,14507.36,E*77" p = NMEASentence(parse_map) p.checksum = '77' p.nmea_sentence = nmea_str result = p.check_chksum() self.assertTrue(result)
def test_basic_parse(self): parse_map = (("Latitude", "lat"), ("Direction", "lat_dir"), ("Longitude", "lon"), ("Direction", "lon_dir")) p = NMEASentence(parse_map) p._parse("$GPGLL,3751.65,S,14507.36,E*77") self.assertEquals("GPGLL", p.sen_type) self.assertEquals(p.parts, ['GPGLL', '3751.65', 'S', '14507.36', 'E'])
def test_basic_parse(self): parse_map = (("Latitude", "lat"), ("Direction", "lat_dir"), ("Longitude", "lon"), ("Direction", "lon_dir")) p = NMEASentence(parse_map) p._parse("$GPGLL,3751.65,S,14507.36,E*77") self.assertEqual("GPGLL", p.sen_type) self.assertEqual(p.parts, ['GPGLL', '3751.65', 'S', '14507.36', 'E'])