Skip to content

Commit

Permalink
Generalize test_tabular for >= 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Serge Rey committed Jun 13, 2021
1 parent b0493f2 commit 8d8580e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libpysal/cg/ops/tests/test_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ def test_dissolve(self):
self.assertEqual(out[0].area, 2.0)
self.assertEqual(out[1].area, 2.0)

answer_vertices0 = [(0, 0), (0, 1), (0, 2), (1, 2), (1, 1), (1, 0), (0, 0)]
answer_vertices1 = [(2, 1), (2, 0), (1, 0), (1, 1), (1, 2), (2, 2), (2, 1)]
answer_vertices0 = set([(0, 0), (0, 1), (0, 2), (1, 2), (1, 1), (1, 0), (0, 0)])
answer_vertices1 = set([(2, 1), (2, 0), (1, 0), (1, 1), (1, 2), (2, 2), (2, 1)])

s0 = set([tuple(map(int,t)) for t in out[0].vertices])
s1 = set([tuple(map(int,t)) for t in out[1].vertices])

self.assertTrue(s0==answer_vertices0)
self.assertTrue(s1==answer_vertices1)

np.testing.assert_allclose(out[0].vertices, answer_vertices0)
np.testing.assert_allclose(out[1].vertices, answer_vertices1)

def test_clip(self):
pass
Expand Down

0 comments on commit 8d8580e

Please sign in to comment.