Skip to content

Commit

Permalink
Feat(refGeo) add benchmark for area route
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Narcisi authored and jacquesfize committed Apr 3, 2024
1 parent c266e84 commit 75f0845
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/dependencies/RefGeo
38 changes: 38 additions & 0 deletions backend/geonature/tests/benchmarks/test_benchmark_ref_geo.py
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=[]),
)()

0 comments on commit 75f0845

Please sign in to comment.