File: test_mapping.py

package info (click to toggle)
python-shapely 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,528 kB
  • sloc: python: 18,648; ansic: 6,615; makefile: 88; sh: 62
file content (14 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import unittest

from shapely.geometry import Point, Polygon, mapping


class MappingTestCase(unittest.TestCase):
    def test_point(self):
        m = mapping(Point(0, 0))
        assert m["type"] == "Point"
        assert m["coordinates"] == (0.0, 0.0)

    def test_empty_polygon(self):
        """Empty polygons will round trip without error"""
        assert mapping(Polygon()) is not None