def test_checksum_passes2(self): p = GPGLL() p.nmea_sentence = "$GPGLL,3751.65,S,14507.36,E*77" p.checksum = '77' result = p.check_chksum() self.assertTrue(result)
def test_checksum_fails2(self): p = GPGLL() p.nmea_sentence = "$GPGLL,3751.65,S,14507.36,E*78" p.checksum = '78' result = p.check_chksum() self.assertFalse(result)
def test_gets_properties(self): p = GPGLL() p.parse("$GPGLL,3751.65,S,14507.36,E*77") self.assertEqual(p.latitude, float('3751.65')) self.assertEqual(p.longitude, float('14507.36')) self.assertEqual(p.lat_direction, 'South') self.assertEqual(p.lon_direction, 'East') self.assertEqual(p.checksum, "77")
def test_gets_properties(self): p = GPGLL() p.parse("$GPGLL,3751.65,S,14507.36,E*77") self.assertEquals(p.latitude, float('3751.65')) self.assertEquals(p.longitude, float('14507.36')) self.assertEquals(p.lat_direction, 'South') self.assertEquals(p.lon_direction, 'East') self.assertEquals(p.checksum, "77")
def test_parses_map2(self): p = GPGLL() p.parse("$GPGLL,4916.45,N,12311.12,W,225444,A") self.assertEqual("GPGLL", p.sen_type) 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("225444", p.timestamp) self.assertEqual("A", p.data_valid)
def test_parses_map1(self): p = GPGLL() p.parse("$GPGLL,3751.65,S,14507.36,E*77") self.assertEqual("GPGLL", p.sen_type) 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("", p.timestamp) # No timestamp given self.assertEqual("77", p.checksum)
def test_parses_map2(self): p = GPGLL() p.parse("$GPGLL,4916.45,N,12311.12,W,225444,A") self.assertEquals("GPGLL", p.sen_type) 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("225444", p.timestamp) self.assertEquals("A", p.data_valid)
def test_parses_map1(self): p = GPGLL() p.parse("$GPGLL,3751.65,S,14507.36,E*77") self.assertEquals("GPGLL", p.sen_type) 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("", p.timestamp) # No timestamp given self.assertEquals("77", p.checksum)