test_v_to_lines.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. """
  2. Created on Sun Jun 09 12:28:03 2018
  3. @author: Sanjeet Bhatti
  4. """
  5. from grass.gunittest.case import TestCase
  6. from grass.gunittest.main import test
  7. from grass.gunittest.gmodules import SimpleModule
  8. class TestVDToLines(TestCase):
  9. """Test v.to.lines script"""
  10. inputMap = 'boundary_municp'
  11. outputMap = 'boundary_municp_lines'
  12. inputMap2 = 'geodetic_pts'
  13. outputMap2 = 'geodetic_pts_lines'
  14. @classmethod
  15. def tearDownClass(cls):
  16. """Remove created vector"""
  17. cls.runModule('g.remove', type='vector', name=(cls.outputMap,
  18. cls.outputMap2), flags='f')
  19. def test_area_to_line_check(self):
  20. """Area to line conversion test"""
  21. module = SimpleModule('v.to.lines', input=self.inputMap,
  22. output=self.outputMap)
  23. self.assertModule(module)
  24. self.assertVectorExists(self.outputMap)
  25. def test_point_to_line_check(self):
  26. """Point to line conversion test"""
  27. module = SimpleModule('v.to.lines', input=self.inputMap2,
  28. output=self.outputMap2, overwrite=True)
  29. self.assertModule(module)
  30. self.assertVectorExists(self.outputMap2)
  31. if __name__ == '__main__':
  32. test()