Skip to content

Commit

Permalink
add export habitat benchmark test
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize authored and VincentCauchois committed Mar 26, 2024
1 parent f551325 commit f966b7b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions backend/geonature/tests/benchmarks/test_benchmark_occhab.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,32 @@
@pytest.mark.usefixtures("client_class", "temporary_transaction")
class TestBenchmarkOcchab:

test_occhab_get_station = BenchmarkTest(
test_get_station = BenchmarkTest(
CLIENT_GET,
[CLater("""url_for("occhab.get_station", id_station=8)""")],
dict(user_profile="user", fixtures=[stations]),
)()

test_occhab_list_stations = BenchmarkTest(
test_list_stations = BenchmarkTest(
CLIENT_GET,
[CLater("""url_for("occhab.list_stations")""")],
dict(user_profile="admin_user", fixtures=[]),
)()

test_occhab_list_stations_restricted = BenchmarkTest(
test_list_stations_restricted = BenchmarkTest(
CLIENT_GET,
[CLater("""url_for("occhab.list_stations")""")],
dict(user_profile="user_restricted_occhab", fixtures=[]),
)()


for format_ in "csv geojson shapefile".split():
setattr(
TestBenchmarkOcchab,
f"test_export_all_habitats_{format_}",
BenchmarkTest(
CLIENT_POST,
[CLater("""url_for("occhab.export_all_habitats",export_format="csv")""")],
dict(user_profile="admin_user", fixtures=[]),
)(),
)

0 comments on commit f966b7b

Please sign in to comment.