test_v_dissolve.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. """
  2. Created on Sun Jun 08 23:58:10 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. from grass.script.core import run_command
  9. class TestVDissolve(TestCase):
  10. """Test v.dissolve script"""
  11. mapName = "mysoils_general"
  12. outputName = "mysoils_general_families"
  13. @classmethod
  14. def setUpClass(cls):
  15. """Copy vect"""
  16. run_command("g.copy", vector="soils_general,mysoils_general")
  17. @classmethod
  18. def tearDownClass(cls):
  19. """Remove vector"""
  20. run_command(
  21. "g.remove", flags="f", type="vector", name=(cls.mapName, cls.outputName)
  22. )
  23. def test_dissolve(self):
  24. """dissolve test"""
  25. module = SimpleModule(
  26. "v.dissolve", input=self.mapName, output=self.outputName, column="GSL_NAME"
  27. )
  28. self.assertModule(module)
  29. self.assertVectorExists(self.outputName)
  30. if __name__ == "__main__":
  31. test()