Skip to content
Snippets Groups Projects
Commit 5e230283 authored by paul.tresson_ird.fr's avatar paul.tresson_ird.fr
Browse files

unit test. does not reproduce the crash

parent e3ed8c90
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import unittest
from qgis.core import QgsProcessingContext, QgsProcessingFeedback
from ..random_forest import RFAlgorithm
from ..similarity import SimilarityAlgorithm
from ..utils.misc import get_file_md5_hash
......@@ -13,6 +14,7 @@ class TestRFAlgorithm(unittest.TestCase):
self.context = QgsProcessingContext()
self.feedback = QgsProcessingFeedback()
self.algorithm = RFAlgorithm()
self.sim = SimilarityAlgorithm()
def test_valid_parameters(self):
self.algorithm.initAlgorithm()
......@@ -23,9 +25,21 @@ class TestRFAlgorithm(unittest.TestCase):
assert result_file_hash == '80b7dd5b5ad5a4c0ad1d637fa20cf8b0'
os.remove(expected_result_path)
def test_rf_then_sim(self):
self.algorithm.initAlgorithm()
parameters = {}
result = self.algorithm.processAlgorithm(parameters, self.context, self.feedback)
self.sim.initAlgorithm()
parameters = {}
result = self.sim.processAlgorithm(parameters, self.context, self.feedback)
self.algorithm.initAlgorithm()
parameters = {}
result = self.algorithm.processAlgorithm(parameters, self.context, self.feedback)
if __name__ == "__main__":
test_algo = TestRFAlgorithm()
test_algo.setUp()
test_algo.test_valid_parameters()
test_algo.test_rf_then_sim()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment