示例#1
0
    def test_checksum_fails(self):
        p = GPHDT()
        p.checksum = '03'
        p.nmea_sentence = '$GPHDT,227.66,T*03'

        result = p.check_chksum()

        self.assertFalse(result)
示例#2
0
    def test_checksum_passes(self):
        p = GPHDT()
        p.checksum = '02'
        p.nmea_sentence = '$GPHDT,227.66,T*02'

        result = p.check_chksum()

        self.assertTrue(result)
示例#3
0
    def test_parses_map(self):
        p = GPHDT()
        p.parse("$GPHDT,227.66,T*02")

        self.assertEqual("GPHDT", p.sen_type)
        self.assertEqual("227.66", p.heading)
        self.assertEqual("T", p.hdg_true)
        self.assertEqual("02", p.checksum)
示例#4
0
    def test_checksum_fails(self):
        p = GPHDT()
        p.checksum = '03'
        p.nmea_sentence = '$GPHDT,227.66,T*03'

        result = p.check_chksum()

        self.assertFalse(result)
示例#5
0
    def test_checksum_passes(self):
        p = GPHDT()
        p.checksum = '02'
        p.nmea_sentence = '$GPHDT,227.66,T*02'

        result = p.check_chksum()

        self.assertTrue(result)
示例#6
0
    def test_parses_map(self):
        p = GPHDT()
        p.parse("$GPHDT,227.66,T*02")

        self.assertEquals("GPHDT", p.sen_type)
        self.assertEquals("227.66", p.heading)
        self.assertEquals("T", p.hdg_true)
        self.assertEquals("02", p.checksum)