test_pathconnect.py 654 B

123456789101112131415161718192021222324252627
  1. import unittest
  2. from shapely.geometry import LineString, Polygon
  3. from shapely.ops import cascaded_union, unary_union
  4. from matplotlib.pyplot import plot, subplot, show, cla, clf, xlim, ylim, title
  5. from camlib import *
  6. class PathConnectTest1(unittest.TestCase):
  7. def setUp(self):
  8. pass
  9. def test_simple_connect(self):
  10. paths = [
  11. LineString([[0, 0], [0, 1]]),
  12. LineString([[0, 1], [0, 2]])
  13. ]
  14. result = Geometry.path_connect(paths)
  15. self.assertEqual(len(result), 1)
  16. self.assertTrue(result[0].equals(LineString([[0, 0], [0, 2]])))
  17. if __name__ == "__main__":
  18. unittest.main()