File: test_box.py

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

from shapely import geometry


class BoxTestCase(unittest.TestCase):
    def test_ccw(self):
        b = geometry.box(0, 0, 1, 1, ccw=True)
        assert b.exterior.coords[0] == (1.0, 0.0)
        assert b.exterior.coords[1] == (1.0, 1.0)

    def test_ccw_default(self):
        b = geometry.box(0, 0, 1, 1)
        assert b.exterior.coords[0] == (1.0, 0.0)
        assert b.exterior.coords[1] == (1.0, 1.0)

    def test_cw(self):
        b = geometry.box(0, 0, 1, 1, ccw=False)
        assert b.exterior.coords[0] == (0.0, 0.0)
        assert b.exterior.coords[1] == (0.0, 1.0)