-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(refGeo) add benchmark for area route
- Loading branch information
1 parent
c266e84
commit 75f0845
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
Submodule RefGeo
updated
2 files
+11 −9 | src/ref_geo/routes.py | |
+15 −0 | src/ref_geo/tests/test_ref_geo.py |
38 changes: 38 additions & 0 deletions
38
backend/geonature/tests/benchmarks/test_benchmark_ref_geo.py
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,38 @@ | ||
import logging | ||
import pytest | ||
from geonature.tests.benchmarks import * | ||
|
||
from .benchmark_generator import BenchmarkTest, CLater | ||
|
||
from .utils import activate_profiling_sql | ||
|
||
logging.basicConfig() | ||
logger = logging.getLogger("logger-name") | ||
logger.setLevel(logging.DEBUG) | ||
|
||
from .utils import CLIENT_GET | ||
|
||
|
||
@pytest.mark.benchmark(group="ref_geo") | ||
@pytest.mark.usefixtures("client_class", "temporary_transaction", "activate_profiling_sql") | ||
class TestBenchmarkRefGeo: | ||
|
||
test_get_areas_with_geom = BenchmarkTest( | ||
CLIENT_GET, | ||
[ | ||
CLater( | ||
"""url_for("ref_geo.get_areas", without_geom="false", type_code=["REG", "DEP", "COM"])""" | ||
) | ||
], | ||
dict(user_profile="admin_user", fixtures=[]), | ||
)() | ||
|
||
test_get_areas_without_geom = BenchmarkTest( | ||
CLIENT_GET, | ||
[ | ||
CLater( | ||
"""url_for("ref_geo.get_areas", without_geom="true", type_code=["REG", "DEP", "COM"])""" | ||
) | ||
], | ||
dict(user_profile="admin_user", fixtures=[]), | ||
)() |