test_addons_toolboxes.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. """
  2. TEST: test_addons_toolboxes.py
  3. AUTHOR(S): Vaclav Petras <wenzeslaus gmail com>
  4. PURPOSE: Test for g.extension toolboxes 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. FULL_TOOLBOXES_OUTPUT = """\
  15. Hydrology (HY)
  16. * r.stream.basins
  17. * r.stream.channel
  18. * r.stream.distance
  19. * r.stream.order
  20. * r.stream.segment
  21. * r.stream.slope
  22. * r.stream.snap
  23. * r.stream.stats
  24. mcda (MC)
  25. * r.mcda.ahp
  26. * r.mcda.roughset
  27. * r.mcda.input
  28. * r.mcda.output
  29. """
  30. class TestToolboxesMetadata(TestCase):
  31. url = "file://" + os.path.abspath("data")
  32. def test_listing(self):
  33. """List toolboxes and their content"""
  34. module = SimpleModule("g.extension", flags="lt", url=self.url)
  35. self.assertModule(module)
  36. stdout = module.outputs.stdout
  37. self.assertMultiLineEqual(stdout, FULL_TOOLBOXES_OUTPUT)
  38. if __name__ == "__main__":
  39. test()