Grass7AlgorithmsImageryTest.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. """
  2. ***************************************************************************
  3. Grass7AlgorithmsImageryTest.py
  4. ------------------------------
  5. Date : May 2016
  6. Copyright : (C) 2016 by Médéric Ribreux
  7. Email : mederic dot ribreux at medspx dot fr
  8. ***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************
  16. """
  17. __author__ = 'Médéric Ribreux'
  18. __date__ = 'May 2016'
  19. __copyright__ = '(C) 2016, Médéric Ribreux'
  20. import AlgorithmsTestBase
  21. import nose2
  22. import shutil
  23. from qgis.core import QgsApplication
  24. from qgis.testing import (
  25. start_app,
  26. unittest
  27. )
  28. from grassprovider.Grass7AlgorithmProvider import Grass7AlgorithmProvider
  29. from grassprovider.Grass7Utils import Grass7Utils
  30. class TestGrass7AlgorithmsImageryTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
  31. @classmethod
  32. def setUpClass(cls):
  33. start_app()
  34. cls.provider = Grass7AlgorithmProvider()
  35. QgsApplication.processingRegistry().addProvider(cls.provider)
  36. cls.cleanup_paths = []
  37. assert Grass7Utils.installedVersion()
  38. @classmethod
  39. def tearDownClass(cls):
  40. QgsApplication.processingRegistry().removeProvider(cls.provider)
  41. for path in cls.cleanup_paths:
  42. shutil.rmtree(path)
  43. def test_definition_file(self):
  44. return 'grass7_algorithms_imagery_tests.yaml'
  45. if __name__ == '__main__':
  46. nose2.main()