Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
iamap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AMAP
iamap
Commits
5e230283
Commit
5e230283
authored
6 months ago
by
paul.tresson_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
unit test. does not reproduce the crash
parent
e3ed8c90
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_rf.py
+14
-0
14 additions, 0 deletions
tests/test_rf.py
with
14 additions
and
0 deletions
tests/test_rf.py
+
14
−
0
View file @
5e230283
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment