Skip to content

Commit

Permalink
add test for nested multigeometries
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Oct 12, 2023
1 parent 09b0435 commit 0b322cf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand All @@ -26,7 +26,7 @@ jobs:
pytest tests --cov=tests --cov=pygeoif --cov-fail-under=100 --cov-report=xml
- name: "Upload coverage to Codecov"
if: ${{ matrix.python-version==3.11 }}
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
Expand Down
4 changes: 2 additions & 2 deletions pygeoif/geometry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2012 -2022 Christian Ledermann
# Copyright (C) 2012 -2023 Christian Ledermann
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -1042,7 +1042,7 @@ def __eq__(self, other: object) -> bool:
[],
),
)
),
)
)

def __len__(self) -> int:
Expand Down
15 changes: 15 additions & 0 deletions tests/test_geometrycollection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Test Baseclass."""
import pytest

from pygeoif import geometry


Expand Down Expand Up @@ -356,3 +358,16 @@ def test_nested_geometry_collection_geo_interface() -> None:
),
"type": "GeometryCollection",
}


@pytest.mark.xfail(reason="Not implemented yet")
def test_nested_geometry_collection_eq() -> None:
multipoint = geometry.MultiPoint([(0, 0), (1, 1), (1, 2), (2, 2)])
gc1 = geometry.GeometryCollection([geometry.Point(0, 0), multipoint])
line = geometry.LineString([(0, 0), (3, 1)])
gc2 = geometry.GeometryCollection([gc1, line])
poly1 = geometry.Polygon([(0, 0), (1, 1), (1, 0), (0, 0)])
gc3 = geometry.GeometryCollection([gc2, poly1])
gc4 = geometry.GeometryCollection([gc2, poly1])

assert gc3 == gc4

0 comments on commit 0b322cf

Please sign in to comment.