示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
    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)