test_addons_modules.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. """
  2. TEST: test_addons_modules.py
  3. AUTHOR(S): Vaclav Petras <wenzeslaus gmail com>
  4. PURPOSE: Test for g.extension individual modules/extensions handling
  5. COPYRIGHT: (C) 2015 Vaclav Petras, and by the GRASS Development Team
  6. This program is free software under the GNU General Public
  7. License (>=v2). Read the file COPYING that comes with GRASS
  8. for details.
  9. """
  10. from grass.gunittest.case import TestCase
  11. from grass.gunittest.main import test
  12. from grass.gunittest.gmodules import SimpleModule
  13. import os
  14. MODULES_OUTPUT = """\
  15. d.frame
  16. d.mon2
  17. g.copyall
  18. g.isis3mt
  19. g.proj.all
  20. r.gdd
  21. r.geomorphon
  22. r.le.patch
  23. r.le.pixel
  24. r.traveltime
  25. r.univar2
  26. v.civil
  27. v.class.ml
  28. v.class.mlpy
  29. v.colors2
  30. v.delaunay3d
  31. v.ellipse
  32. v.in.proj
  33. v.in.redwg
  34. v.neighborhoodmatrix
  35. v.transects
  36. wx.metadata
  37. """.replace('\n', os.linesep)
  38. class TestModulesMetadata(TestCase):
  39. url = 'file://' + os.path.abspath('data')
  40. def test_limits(self):
  41. """Test if results is in expected limits"""
  42. module = SimpleModule('g.extension', flags='l', svnurl=self.url)
  43. self.assertModule(module)
  44. stdout = module.outputs.stdout
  45. self.assertMultiLineEqual(stdout, MODULES_OUTPUT)
  46. if __name__ == '__main__':
  47. test()