"""Tests para point_in_polygons_bbox."""

import os
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", ".."))

from python.functions.geo.point_in_polygons_bbox import point_in_polygons_bbox
from python.functions.geo.polygon_bbox import polygon_bbox

P1 = [[(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]]
P2 = [[(5.0, 5.0), (6.0, 5.0), (6.0, 6.0), (5.0, 6.0)]]
BBOXES = [polygon_bbox(P1), polygon_bbox(P2)]


def test_punto_en_primer_poligono():
    assert point_in_polygons_bbox(0.5, 0.5, [P1, P2], BBOXES) is True


def test_punto_en_segundo_poligono():
    assert point_in_polygons_bbox(5.5, 5.5, [P1, P2], BBOXES) is True


def test_punto_fuera_de_todos():
    assert point_in_polygons_bbox(10.0, 10.0, [P1, P2], BBOXES) is False
