예제 #1
0
def test_reversals(multiregions_pair: MultiregionsPair) -> None:
    left_multiregion, right_multiregion = multiregions_pair

    result = intersect_multiregions(left_multiregion, right_multiregion)

    assert result == intersect_multiregions(
            reverse_multiregion(left_multiregion), right_multiregion)
    assert result == intersect_multiregions(
            left_multiregion, reverse_multiregion(right_multiregion))
    assert result == intersect_multiregions(
            reverse_multiregion_regions(left_multiregion), right_multiregion)
    assert result == intersect_multiregions(
            left_multiregion, reverse_multiregion_regions(right_multiregion))
예제 #2
0
def test_reversals(multiregions_pair: Tuple[Multiregion, Multiregion]) -> None:
    left, right = multiregions_pair

    result = multiregion_in_multiregion(left, right)

    assert result is multiregion_in_multiregion(reverse_multiregion(left),
                                                right)
    assert result is multiregion_in_multiregion(left,
                                                reverse_multiregion(right))
    assert result is multiregion_in_multiregion(
        reverse_multiregion_regions(left), right)
    assert result is multiregion_in_multiregion(
        left, reverse_multiregion_regions(right))
    assert result is multiregion_in_multiregion(
        reverse_multiregion_coordinates(left),
        reverse_multiregion_coordinates(right))
예제 #3
0
def test_reversals(multiregion_with_point: Tuple[Multiregion, Point]) -> None:
    multiregion, point = multiregion_with_point

    result = point_in_multiregion(point, multiregion)

    assert result is point_in_multiregion(point,
                                          reverse_multiregion(multiregion))
    assert result is point_in_multiregion(
        point, reverse_multiregion_regions(multiregion))
    assert result is point_in_multiregion(
        reverse_point_coordinates(point),
        reverse_multiregion_coordinates(multiregion))
예제 #4
0
def test_reversals(
        multiregion_with_segment: Tuple[Multiregion, Segment]) -> None:
    multiregion, segment = multiregion_with_segment

    result = segment_in_multiregion(segment, multiregion)

    assert result is segment_in_multiregion(reverse_segment(segment),
                                            multiregion)
    assert result is segment_in_multiregion(segment,
                                            reverse_multiregion(multiregion))
    assert result is segment_in_multiregion(
        segment, reverse_multiregion_regions(multiregion))
    assert result is segment_in_multiregion(
        reverse_segment_coordinates(segment),
        reverse_multiregion_coordinates(multiregion))
예제 #5
0
def test_reversals(
        multiregion_with_contour: Tuple[Multiregion, Contour]) -> None:
    multiregion, contour = multiregion_with_contour

    result = contour_in_multiregion(contour, multiregion)

    assert result is contour_in_multiregion(reverse_contour(contour),
                                            multiregion)
    assert result is contour_in_multiregion(contour,
                                            reverse_multiregion(multiregion))
    assert result is contour_in_multiregion(
        contour, reverse_multiregion_regions(multiregion))
    assert result is contour_in_multiregion(
        reverse_contour_coordinates(contour),
        reverse_multiregion_coordinates(multiregion))
예제 #6
0
def test_reversals(
        multiregion_with_region: Tuple[Multiregion, Region]) -> None:
    multiregion, region = multiregion_with_region

    result = region_in_multiregion(region, multiregion)

    assert result is region_in_multiregion(reverse_contour(region),
                                           multiregion)
    assert result is region_in_multiregion(region,
                                           reverse_multiregion(multiregion))
    assert result is region_in_multiregion(
        region, reverse_multiregion_regions(multiregion))
    assert result is region_in_multiregion(
        reverse_contour_coordinates(region),
        reverse_multiregion_coordinates(multiregion))