From d541ccd02de3a1fa52029a20dd2bd13a318c5e77 Mon Sep 17 00:00:00 2001 From: Silvio Giannini Date: Thu, 16 Feb 2023 17:40:34 +0100 Subject: [PATCH] fix: https://github.com/italia/spid-sp-test/issues/156 --- src/spid_sp_test/__init__.py | 2 +- src/spid_sp_test/indicepa.py | 16 ++++++++-------- tests/test_04_units.py | 3 +++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/spid_sp_test/__init__.py b/src/spid_sp_test/__init__.py index 5ef73cc..8a41044 100644 --- a/src/spid_sp_test/__init__.py +++ b/src/spid_sp_test/__init__.py @@ -6,7 +6,7 @@ BASE_DIR = Path(__file__).resolve().parent -__version__ = "1.2.12" +__version__ = "1.2.13" __name__ = "spid_sp_test" logger = logging.getLogger(__name__) diff --git a/src/spid_sp_test/indicepa.py b/src/spid_sp_test/indicepa.py index 441c7e1..f258e7f 100644 --- a/src/spid_sp_test/indicepa.py +++ b/src/spid_sp_test/indicepa.py @@ -2,27 +2,27 @@ import requests -API_URL = "https://indicepa.gov.it/PortaleServices/api/aoo" +API_URL = "https://www.indicepa.gov.it/PortaleServices/api/ente/ricerca" logger = logging.getLogger(__name__) def get_indicepa_by_ipacode(value): qs = """ {"paginazione": - {"campoOrdinamento":"codAoo", + {"campoOrdinamento":"idEnte", "tipoOrdinamento":"asc", "paginaRichiesta":1, "numTotalePagine":null, "numeroRigheTotali":null, "paginaCorrente":null, "righePerPagina":null}, - "codiceFiscale":null, - "codUniAoo":null, - "desAoo":null, - "denominazioneEnte":null, + "codiceFiscaleRicerca":null, + "area":null, + "denominazione":null, "codEnte":"$IPACode", - "codiceCategoria":null, - "area":null + "idTipoServizioDigitale":null, + "lingueMinoritarie":null, + "codiceCategoria":null }""" qs_final = qs.replace("$IPACode", value) diff --git a/tests/test_04_units.py b/tests/test_04_units.py index af68b07..26a79fc 100644 --- a/tests/test_04_units.py +++ b/tests/test_04_units.py @@ -5,3 +5,6 @@ def test_indicepa(): def test_indicepa_2(): res = get_indicepa_by_ipacode('r_vda') + +def test_indicepa_3(): + res = get_indicepa_by_ipacode('cnpaf_0') \ No newline at end of file