Skip to content

Commit

Permalink
Test test_get_groupe3_inpn and format of taxrefDetail response
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl committed Oct 23, 2023
1 parent 16835ae commit 060e81b
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions apptax/tests/test_taxref.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,35 @@ class TestAPITaxref:
}
]
)
schema_taxref_detail = Schema(
{
"cd_nom": int,
"cd_ref": int,
"cd_sup": int,
"cd_taxsup": int,
"famille": str,
"group1_inpn": str,
"group2_inpn": str,
"group3_inpn": str,
"id_rang": str,
"nom_complet": str,
"nom_habitat": str,
"nom_rang": str,
"nom_statut": str,
"nom_valide": str,
"nom_vern": str,
"ordre": str,
"phylum": str,
"regne": str,
"status": dict,
"synonymes": [
{
"cd_nom": int,
"nom_complet": str,
}
],
}
)

def test_get_allnamebyListe_routes(self):
query_string = {"limit": 10}
Expand Down Expand Up @@ -103,6 +132,9 @@ def test_searchfield_routes(self):
def test_taxrefDetail_routes(self):
response = self.client.get(url_for("taxref.getTaxrefDetail", id=29708))
assert response.status_code == 200
data = response.json
if data:
assert self.schema_taxref_detail.is_valid(data)

def test_searchTaxref_routes(self):
query_string = {"ilike-classe": "hex", "page": 1, "limit": 10}
Expand All @@ -125,3 +157,11 @@ def test_taxrefversion_routes(self):
response = self.client.get(url_for("taxref.getTaxrefVersion"))
assert response.status_code == 200
assert json.loads(response.data)["version"] == 16

def test_get_groupe3_inpn(self):
response = self.client.get(url_for("taxref.get_group3_inpn_taxref"))

assert response.status_code == 200
response_json = response.json
assert "Coléoptères" in response_json
assert "Autres" in response_json

0 comments on commit 060e81b

Please sign in to comment.