Skip to content

Commit

Permalink
fix(tests) add config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Narcisi committed Aug 26, 2024
1 parent 8f2a3c0 commit b5fdc9b
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ jobs:
geonature db upgrade ref_geo_fr_municipalities@head
geonature db upgrade ref_geo_inpn_grids_10@head
env:
GEONATURE_CONFIG_FILE: dependencies/GeoNature/config/test_config.toml
GEONATURE_CONFIG_FILE: test_config.toml
- name: Install mtd_sync
run: |
pip install .
- name: Test with pytest
run: |
pytest -v --cov --cov-report xml
env:
GEONATURE_CONFIG_FILE: dependencies/GeoNature/config/test_config.toml
GEONATURE_CONFIG_FILE: test_config.toml
GEONATURE_SETTINGS: mtd_sync.test_config
- name: Upload coverage to Codecov
if: ${{ matrix.debian-version == '12' }}
Expand Down
76 changes: 76 additions & 0 deletions test_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
SQLALCHEMY_DATABASE_URI = "postgresql://geonatadmin:[email protected]:5432/geonature2db"
URL_APPLICATION = 'http://127.0.0.1:4200'
API_ENDPOINT = 'http://127.0.0.1:8000'
SECRET_KEY = '5fdc2c8fb46f44033144d07396ba082a95b8b3cc827b611a7aaaefbef414f13b'
DEFAULT_LANGUAGE='fr'
[MAPCONFIG]
ZOOM_LEVEL_RELEVE = 1
REF_LAYERS=[
{
code="znieff1",
type="wms",
label="Znieff de Bretagne",
activate=false,
url="https://geobretagne.fr/geoserver/dreal_b/znieff1/wms",
params={layers="znieff1", crs="EPSG:4326", service="wms", format="image/png", version="1.3.0", request="GetMap", transparent=true}
}, {
code="COM_LYON",
type="wfs",
label="Communes du Grand Lyon",
activate=false,
style={
color= "red",
fill= true,
fillOpacity= "0.2",
weight= 2,
fillColor= "blue"
},
url="https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&request=GetFeature&typename=adr_voie_lieu.adrcomgl&outputFormat=geojson&SRSNAME=EPSG:4326"
}, {
code="VEGE_POST_ELEC",
type="geojson",
label="Végétation dans les postes élec.",
activate=false,
style={
color= "#ffa43b",
fill= false,
fillOpacity= "0.0",
weight= 2
},
url="https://www.data.gouv.fr/fr/datasets/r/02aaadfa-f774-4b92-b81f-9f1436182701"
}, {
code="COM",
label="Communes",
activate=true,
type="area",
style={
color= "grey",
fill= false,
fillOpacity= "0.0",
weight= 2
},
params= {limit= 2000}
},
]

[SYNTHESE]
AREA_AGGREGATION_TYPE = "M5"
STATUS_FILTERS = [
{ "id" = "protections", "show" = true, "display_name" = "Taxons protégés", "status_types" = ["PN", "PR", "PD"] },
{ "id" = "regulations", "show" = true, "display_name" = "Taxons réglementés", "status_types" = ["REGLII", "REGL", "REGLSO"] },
{ "id" = "invasive", "show" = true, "display_name" = "Espèces envahissantes", "status_types" = ["REGLLUTTE"] },
{ "id" = "znief", "show" = true, "display_name" = "Espèces déterminantes ZNIEFF", "status_types" = ["ZDET"] },
]

BASE_URL="lalala"
XML_NAMESPACE="{http://inpn.mnhn.fr/mtd}"
USER="lalala"
PASSWORD="lalala"
ID_INSTANCE_FILTER=0
MTD_API_ENDPOINT="https://preprod-inpn.mnhn.fr/mtd"
SYNC_LOG_LEVEL="INFO"
USERS_CAN_SEE_ORGANISM_DATA=false
JDD_MODULE_CODE_ASSOCIATION = ["OCCTAX", "OCCHAB"]
ID_PROVIDER="cas_inpn"
ID_USER_SOCLE_1=1
ID_USER_SOCLE_2=2

0 comments on commit b5fdc9b

Please sign in to comment.