"""Tests para polygon_bbox.""" import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", "..")) from python.functions.geo.polygon_bbox import polygon_bbox def test_cuadrado_unitario(): ring = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)] assert polygon_bbox([ring]) == (0.0, 0.0, 1.0, 1.0) def test_poligono_con_hole(): outer = [(0.0, 0.0), (5.0, 0.0), (5.0, 5.0), (0.0, 5.0)] hole = [(1.0, 1.0), (3.0, 1.0), (3.0, 3.0), (1.0, 3.0)] assert polygon_bbox([outer, hole]) == (0.0, 0.0, 5.0, 5.0)