コード例 #1
0
ファイル: test_nmea_parse.py プロジェクト: Hackerfleet/pynmea
    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)
コード例 #2
0
ファイル: test_nmea_parse.py プロジェクト: Hackerfleet/pynmea
    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)
コード例 #3
0
    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)
コード例 #4
0
    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)
コード例 #5
0
ファイル: test_nmea_parse.py プロジェクト: Hackerfleet/pynmea
    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")
コード例 #6
0
    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")
コード例 #7
0
ファイル: test_nmea_parse.py プロジェクト: Hackerfleet/pynmea
    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)
コード例 #8
0
ファイル: test_nmea_parse.py プロジェクト: Hackerfleet/pynmea
    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)
コード例 #9
0
    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)
コード例 #10
0
    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)