File: tippecanoe_test.py

package info (click to toggle)
tippecanoe 2.53.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 148,236 kB
  • sloc: cpp: 44,069; ansic: 2,057; makefile: 454; perl: 129; python: 62; sh: 4
file content (26 lines) | stat: -rw-r--r-- 773 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from tippecanoe import split_key
import unittest

class TestTippecanoe(unittest.TestCase):
    def test_basic(self):
        root, ext = split_key("file.json")
        self.assertEqual(root,"file")
        self.assertEqual(ext,".json")

    def test_basic_gz(self):
        root, ext = split_key("file.csv.gz")
        self.assertEqual(root,"file")
        self.assertEqual(ext,".csv.gz")

    def test_nested_key(self):
        root, ext = split_key("dir/file.fgb")
        self.assertEqual(root,"dir/file")
        self.assertEqual(ext,".fgb")

    def test_nested_key_gz(self):
        root, ext = split_key("dir/file.geojsonseq.gz")
        self.assertEqual(root,"dir/file")
        self.assertEqual(ext,".geojsonseq.gz")

if __name__ == '__main__':
    unittest.main()