Skip to content

Commit

Permalink
kill mutants
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Ledermann committed Jun 19, 2021
1 parent 17e429d commit 49f5c06
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pygeoif/tests/test_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ def test_box_cw():
}


def test_shell_holes_from_wkt_coords():
shell, holes = factories._shell_holes_from_wkt_coords(
[
["0 0", "10 20", "30 40", "0 0"],
],
)
assert holes is None
assert shell == [(0.0, 0.0), (10.0, 20.0), (30.0, 40.0), (0.0, 0.0)]


class WKTTestCase(unittest.TestCase):

# valid and supported WKTs
Expand Down
7 changes: 7 additions & 0 deletions pygeoif/tests/test_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,10 @@ def test_featurecollection_repr_eval(self):
).__geo_interface__,
self.fc.__geo_interface__,
)

def test_featureclloection_bounds(self):
ls1 = geometry.LineString(((0, 1), (1, 1)))
ls2 = geometry.LineString(((2, 3), (3, 4)))
fc = feature.FeatureCollection([feature.Feature(ls1), feature.Feature(ls2)])

self.assertEqual(fc.bounds, (0, 1, 3, 4))
10 changes: 10 additions & 0 deletions pygeoif/tests/test_geometrycollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@ def test_neq_type():
assert gc1 != line


def test_neq_coords():
p0 = geometry.Point(0, 0)
p1 = geometry.Point(-1, -1)
p2 = geometry.Point(-1, -2)
gc1 = geometry.GeometryCollection([p0, p1])
gc2 = geometry.GeometryCollection([p0, p2])

assert gc1 != gc2


def test_neq_interface():
line = geometry.LineString([(0, 0), (1, 1)])
gc1 = geometry.GeometryCollection([line])
Expand Down
5 changes: 5 additions & 0 deletions pygeoif/tests/test_linear_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,8 @@ def test_set_orientation_3d_clockwise():
ring._set_orientation(True)

assert ring.coords == ((0, 0, 5), (1, 1, 7), (1, 0, 6), (0, 0, 5))


def test_signed_area():
assert geometry.signed_area(((0.0, 0.0), (1.0, 1.0), (2, 0), (0, 0))) == -1.0
assert geometry.signed_area(((0, 0, 5), (1, 0, 6), (1, 1, 7), (0, 0, 5))) == 0.5
10 changes: 9 additions & 1 deletion pygeoif/tests/test_multipoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ def test_len():
assert len(multipoint) == 8


def test_bounds():
multipoint = geometry.MultiPoint(
[(0, 1), (1, 1), (3, 2)],
)

assert multipoint.bounds == (0, 1, 3, 2)


def test_geo_interface():
multipoint = geometry.MultiPoint([(0, 0), (1, 1), (1, 2), (2, 2)])

Expand Down Expand Up @@ -50,7 +58,7 @@ def test_coords():

with pytest.raises(
NotImplementedError,
match="Multi-part geometries do not provide a coordinate sequence",
match="^Multi-part geometries do not provide a coordinate sequence$",
):
multipoint.coords

Expand Down

0 comments on commit 49f5c06

Please sign in to comment.