test_r_plane.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. """
  2. Created on Sun Jun 08 12:12:34 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 TestRPlane(TestCase):
  9. """Test r.plane script"""
  10. mapName = "elevation"
  11. mapOutput = "myplane45"
  12. @classmethod
  13. def setUpClass(cls):
  14. """Create maps in a small region."""
  15. cls.use_temp_region()
  16. cls.runModule("g.region", raster=cls.mapName, flags="p")
  17. @classmethod
  18. def tearDownClass(cls):
  19. """Remove temporary region"""
  20. cls.runModule("g.remove", flags="f", type="raster", name=cls.mapOutput)
  21. cls.del_temp_region()
  22. def test_creates_raster_plane_map(self):
  23. """Create a tilted plane raster map test"""
  24. module = SimpleModule(
  25. "r.plane",
  26. output=self.mapOutput,
  27. dip=45,
  28. easting=527500.0,
  29. northing=165000.0,
  30. elevation=1000,
  31. type="FCELL",
  32. )
  33. self.assertModule(module)
  34. self.assertRasterExists(self.mapOutput)
  35. if __name__ == "__main__":
  36. test()