-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synchronize docs between DataCube, VectorCube, ...
- Loading branch information
Showing
6 changed files
with
199 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import pytest | ||
|
||
from openeo import DataCube, VectorCube | ||
from openeo.internal.documentation import assert_same_param_docs, extract_params | ||
from openeo.rest.mlmodel import MlModel | ||
from openeo.rest.stac_resource import StacResource | ||
|
||
|
||
def test_extract_params(): | ||
assert ( | ||
extract_params( | ||
""" | ||
The description | ||
and more | ||
:param a: description of a | ||
:param b_b : multi-line description | ||
of b | ||
That's it! | ||
""" | ||
) | ||
== { | ||
"a": "description of a", | ||
"b_b": "multi-line description\n of b", | ||
} | ||
) | ||
|
||
|
||
def test_compare_param_docs_datacube(): | ||
assert_same_param_docs(DataCube.download, DataCube.create_job, only_intersection=True) | ||
assert_same_param_docs(DataCube.download, DataCube.execute_batch, only_intersection=True) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
["method_a", "method_b"], | ||
[ | ||
(DataCube.download, VectorCube.download), | ||
(DataCube.create_job, VectorCube.create_job), | ||
(DataCube.execute_batch, VectorCube.execute_batch), | ||
], | ||
) | ||
def test_compare_docs_datacube_vectorcube(method_a, method_b): | ||
assert_same_param_docs(method_a, method_b, only_intersection=False) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
["method_a", "method_b"], | ||
[ | ||
(DataCube.create_job, MlModel.create_job), | ||
(DataCube.execute_batch, MlModel.execute_batch), | ||
], | ||
) | ||
def test_compare_docs_datacube_mlmodel(method_a, method_b): | ||
assert_same_param_docs(method_a, method_b, only_intersection=True) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
["method_a", "method_b"], | ||
[ | ||
(DataCube.download, StacResource.download), | ||
(DataCube.create_job, StacResource.create_job), | ||
(DataCube.execute_batch, StacResource.execute_batch), | ||
], | ||
) | ||
def test_compare_docs_datacube_stac_resource(method_a, method_b): | ||
assert_same_param_docs(method_a, method_b, only_intersection=True) |