def test_checksum_fails(self): p = GPHDG() p.checksum = '7E' p.nmea_sentence = "$GPHDG,190.7,,E,0.0,E*7E" result = p.check_chksum() self.assertFalse(result)
def test_checksum_passes(self): p = GPHDG() p.checksum = '7F' p.nmea_sentence = "$GPHDG,190.7,,E,0.0,E*7F" result = p.check_chksum() self.assertTrue(result)
def test_parses_map(self): p = GPHDG() p.parse("$GPHDG,190.7,,E,0.0,E*7F") self.assertEqual("GPHDG", p.sen_type) self.assertEqual("190.7", p.heading) self.assertEqual("", p.deviation) self.assertEqual("E", p.dev_dir) self.assertEqual("0.0", p.variation) self.assertEqual("E", p.var_dir) self.assertEqual("7F", p.checksum)
def test_parses_map(self): p = GPHDG() p.parse("$GPHDG,190.7,,E,0.0,E*7F") self.assertEquals("GPHDG", p.sen_type) self.assertEquals("190.7", p.heading) self.assertEquals("", p.deviation) self.assertEquals("E", p.dev_dir) self.assertEquals("0.0", p.variation) self.assertEquals("E", p.var_dir) self.assertEquals("7F", p.checksum)