Пример #1
0
 def test_other_nmea_sentence(self):
     """
     the calculate checksum method can be used with other types of NMEA
     sentences
     """
     testsentence = ('$GPRMC,152904.000,A,4611.1699,N,00117.8182,'
                     'W,000.00,0.0,240714,,,E*46')
     self.assertTrue(nmea.calculate_nmea_checksum(testsentence, start='$'))
Пример #2
0
 def test_incorrect_nmea_checksum(self):
     """
     feed in an NMEA 0183 sentence and calculate its checksum
     checksum should be incorrect and False
     """
     testsentence = ('!AIVDM,1,1,,B,E>jHC=c6:W2h22R`@1:WdP00000Opa'
                     '@F?KTa010888e?B0,0*75')
     self.assertFalse(nmea.calculate_nmea_checksum(testsentence))