def test_parses_map_2(self): p = GPRMC() p.parse("$GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68") self.assertEqual("GPRMC", p.sen_type) self.assertEqual("225446", p.timestamp) self.assertEqual("A", p.data_validity) self.assertEqual("4916.45", p.lat) self.assertEqual("N", p.lat_dir) self.assertEqual("12311.12", p.lon) self.assertEqual("W", p.lon_dir) self.assertEqual("000.5", p.spd_over_grnd) self.assertEqual("054.7", p.true_course) self.assertEqual("191194", p.datestamp) self.assertEqual("020.3", p.mag_variation) self.assertEqual("E", p.mag_var_dir) self.assertEqual("68", p.checksum)
def test_parses_map_3(self): p = GPRMC() p.parse("$GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70") self.assertEqual("GPRMC", p.sen_type) self.assertEqual("220516", p.timestamp) self.assertEqual("A", p.data_validity) self.assertEqual("5133.82", p.lat) self.assertEqual("N", p.lat_dir) self.assertEqual("00042.24", p.lon) self.assertEqual("W", p.lon_dir) self.assertEqual("173.8", p.spd_over_grnd) self.assertEqual("231.8", p.true_course) self.assertEqual("130694", p.datestamp) self.assertEqual("004.2", p.mag_variation) self.assertEqual("W", p.mag_var_dir) self.assertEqual("70", p.checksum)
def test_parses_map_1(self): p = GPRMC() p.parse("$GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62") self.assertEqual("GPRMC", p.sen_type) self.assertEqual("081836", p.timestamp) self.assertEqual("A", p.data_validity) self.assertEqual("3751.65", p.lat) self.assertEqual("S", p.lat_dir) self.assertEqual("14507.36", p.lon) self.assertEqual("E", p.lon_dir) self.assertEqual("000.0", p.spd_over_grnd) self.assertEqual("360.0", p.true_course) self.assertEqual("130998", p.datestamp) self.assertEqual("011.3", p.mag_variation) self.assertEqual("E", p.mag_var_dir) self.assertEqual("62", p.checksum)
def test_parses_map_3(self): p = GPRMC() p.parse( "$GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70" ) self.assertEquals("GPRMC", p.sen_type) self.assertEquals("220516", p.timestamp) self.assertEquals("A", p.data_validity) self.assertEquals("5133.82", p.lat) self.assertEquals("N", p.lat_dir) self.assertEquals("00042.24", p.lon) self.assertEquals("W", p.lon_dir) self.assertEquals("173.8", p.spd_over_grnd) self.assertEquals("231.8", p.true_course) self.assertEquals("130694", p.datestamp) self.assertEquals("004.2", p.mag_variation) self.assertEquals("W", p.mag_var_dir) self.assertEquals("70", p.checksum)
def test_parses_map_2(self): p = GPRMC() p.parse( "$GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68" ) self.assertEquals("GPRMC", p.sen_type) self.assertEquals("225446", p.timestamp) self.assertEquals("A", p.data_validity) self.assertEquals("4916.45", p.lat) self.assertEquals("N", p.lat_dir) self.assertEquals("12311.12", p.lon) self.assertEquals("W", p.lon_dir) self.assertEquals("000.5", p.spd_over_grnd) self.assertEquals("054.7", p.true_course) self.assertEquals("191194", p.datestamp) self.assertEquals("020.3", p.mag_variation) self.assertEquals("E", p.mag_var_dir) self.assertEquals("68", p.checksum)
def test_parses_map_1(self): p = GPRMC() p.parse( "$GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62" ) self.assertEquals("GPRMC", p.sen_type) self.assertEquals("081836", p.timestamp) self.assertEquals("A", p.data_validity) self.assertEquals("3751.65", p.lat) self.assertEquals("S", p.lat_dir) self.assertEquals("14507.36", p.lon) self.assertEquals("E", p.lon_dir) self.assertEquals("000.0", p.spd_over_grnd) self.assertEquals("360.0", p.true_course) self.assertEquals("130998", p.datestamp) self.assertEquals("011.3", p.mag_variation) self.assertEquals("E", p.mag_var_dir) self.assertEquals("62", p.checksum)
def test_checksum_fails(self): p = GPRMC() p.checksum = '71' p.nmea_sentence = '$GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*71' result = p.check_chksum() self.assertFalse(result)