Skip to content

Commit

Permalink
[BUG]fix(response): return empty dict if immat is null
Browse files Browse the repository at this point in the history
Merge pull request #420 from annuaire-entreprises-data-gouv-fr/fix-immat
  • Loading branch information
HAEKADI authored Sep 18, 2024
2 parents d888566 + 9adf9b5 commit ddc3152
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/unite_legale.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class UniteLegaleResponse(BaseModel):
statut_diffusion: str | None = None
matching_etablissements: list[Etablissement] | None = None
etablissements: list[Etablissement] | None = None
immatriculation: Immatriculation = None
immatriculation: Immatriculation | None = None
finances: dict[str, Finances] | None = None
complements: Complements = None
score: float | None = None
Expand Down
6 changes: 4 additions & 2 deletions app/tests/e2e_tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def test_siren_insee_only(api_response_tester):


def test_siren_rne_and_insee(api_response_tester):
path = "search?q=356000000"
path = "search?q=552081317"
response = api_response_tester.get_api_response(path)
api_response_tester.assert_api_response_code_200(path)
assert response.json()["results"][0]["date_mise_a_jour_rne"] is not None
Expand Down Expand Up @@ -712,7 +712,8 @@ def test_immatriculation(api_response_tester):
"""
Test immatriculation object.
"""
# Test for "la poste"
# Test for "la poste" : deactivated awaiting inpi response
"""
path_la_poste = "search?q=la%20poste&include_admin=immatriculation"
api_response_tester.assert_api_response_code_200(path_la_poste)
Expand All @@ -733,6 +734,7 @@ def test_immatriculation(api_response_tester):
api_response_tester.test_field_value(
path_la_poste, 0, f"immatriculation.{field}", expected_value
)
"""

# Test for "ganymede"
path_gan = "search?q=880878145&include_admin=immatriculation"
Expand Down

0 comments on commit ddc3152

Please sign in to comment.