예제 #1
0
    def test_ppl17_699(self):
        """
        Simple case: commission, then séance publique on adopted text
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl17-699") == DossierRef(
            uid="ppl17-699",
            titre=
            "Instituer un médiateur territorial dans certaines collectivités",
            slug="instituer-mediateur-territorial-certaines-collectivites",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl17-699.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2018X699",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=699,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2018, 7, 30),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X547",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=547,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 6, 5),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #2
0
    def test_ppl18_462(self):
        """
        Simple case: commission, then séance publique on adopted text
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-462") == DossierRef(
            uid="ppl18-462",
            titre=
            "Participation des conseillers de Lyon aux élections sénatoriales",
            slug="participation-conseillers-lyon-elections-senatoriales",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-462.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2019X462",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=462,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 4, 16),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X552",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=552,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 6, 5),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #3
0
    def test_ppl18_043(self):
        """
        Première & nouvelle lecture
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-043") == DossierRef(
            uid="ppl18-043",
            titre=
            "Directeur général de l'Agence nationale de la cohésion des territoires",  # noqa
            slug="directeur-general-agence-nationale-cohesion-territoires",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-043.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2018X43",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=43,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2018, 10, 16),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2018X100",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=100,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2018, 10, 31),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #4
0
    def test_pjl18_526(self):
        """
        Simple case: commission, then séance publique on adopted text
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("pjl18-526") == DossierRef(
            uid="pjl18-526",
            titre="Accords France-Suisse et France-Luxembourg",
            slug="accords-france-suisse-france-luxembourg",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/pjl18-526.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PJLSENAT2019X526",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=526,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 5, 24),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PJLSENAT2019X567",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=567,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 6, 12),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #5
0
    def test_ppl18_454(self):
        """
        Commission has not adopted a new texte yet
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-454") == DossierRef(
            uid="ppl18-454",
            titre="Exploitation des réseaux radioélectriques mobiles",
            slug="exploitation-reseaux-radioelectriques-mobiles",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-454.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2019X454",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=454,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 4, 11),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X454",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=454,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 4, 11),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #6
0
    def test_pjl18_532(self):
        """
        Simple case: commission, then séance publique on adopted text
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("pjl18-532") == DossierRef(
            uid="pjl18-532",
            titre="Transformation de la fonction publique",
            slug="transformation-fonction-publique",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/pjl18-532.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PJLSENAT2019X532",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=532,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 5, 29),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PJLSENAT2019X571",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=571,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 6, 12),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #7
0
    def test_ppl18_386(self):
        """
        Simple case: commission, then séance publique on adopted text
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-386") == DossierRef(
            uid="ppl18-386",
            titre="Clarifier diverses dispositions du droit électoral",
            slug="clarifier-diverses-dispositions-droit-electoral",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-386.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2019X386",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=386,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 3, 19),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X445",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=445,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 4, 10),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #8
0
    def test_ppl18_436(self):
        """
        Commission does not vote a new texte
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-436") == DossierRef(
            uid="ppl18-436",
            titre="Accès des PME à la commande publique",
            slug="acces-pme-commande-publique",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-436.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2019X436",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=436,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 4, 4),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X436",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=436,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 4, 4),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #9
0
    def test_ppl18_260(self):
        """
        Commission does not vote a new texte
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-260") == DossierRef(
            uid="ppl18-260",
            titre="Accès à l'énergie et lutte contre la précarité énergétique",
            slug="acces-energie-lutte-contre-precarite-energetique",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-260.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2019X260",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=260,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 1, 22),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X260",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=260,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 1, 22),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #10
0
    def test_ppl18_305(self):
        """
        Commission does not vote a new texte
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-305") == DossierRef(
            uid="ppl18-305",
            titre="Création d'un statut de l'élu communal",
            slug="creation-statut-elu-communal",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-305.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2019X305",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=305,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 2, 12),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X305",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=305,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 2, 12),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #11
0
    def test_pjl18_404(self):
        """
        Simple case: commission, then séance publique on adopted text
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("pjl18-404") == DossierRef(
            uid="pjl18-404",
            titre="Organisation du système de santé",
            slug="organisation-systeme-sante",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/pjl18-404.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PJLSENAT2019X404",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=404,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 3, 26),
                    ),
                    organe="",  # commission X
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PJLSENAT2019X525",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=525,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 5, 22),
                    ),
                    organe="PO78718",  # séance publique
                    partie=None,
                ),
            ],
        )
예제 #12
0
    def test_ppr18_458(self):
        """
        Résolution: the government is most likely not involved
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppr18-458") == DossierRef(
            uid="ppr18-458",
            titre="Clarifier et actualiser le Règlement du Sénat",
            slug="clarifier-actualiser-reglement-senat",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppr18-458.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPRSENAT2019X458",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=458,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 4, 12),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPRSENAT2019X550",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=550,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 6, 5),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #13
0
def find_examen_commission(
    phase: Phase,
    entries: Iterable[element.Tag],
    textes: Dict[int, TexteRef],
    partie: Optional[int],
) -> Optional[LectureRef]:
    for entry in entries:
        if not entry.title.string.startswith("Texte n°"):
            continue

        if extract_phase(entry) != phase:
            continue

        if not is_texte_initial(entry.summary.string):
            continue

        num_texte = extract_texte_num(entry.title.string)
        if not num_texte:
            continue

        texte = textes[num_texte]

        return LectureRef(
            chambre=Chambre.SENAT,
            phase=phase,
            titre=f"{_PHASE_TO_STR[phase]} – Commissions",
            organe="",
            texte=texte,
            partie=partie,
        )
    return None
예제 #14
0
def find_amendements_seance_publique(
    phase: Phase,
    entries: Iterable[element.Tag],
    textes: Dict[int, TexteRef],
    partie: Optional[int],
) -> Iterator[LectureRef]:
    for entry in entries:
        if extract_phase(entry) != phase:
            continue

        num_texte = extract_texte_num(
            entry.title.string,
            regexp=r"Amendements déposés sur le texte n°\s*(\d+)")
        if not num_texte:
            continue

        texte = textes[num_texte]

        yield LectureRef(
            chambre=Chambre.SENAT,
            phase=phase,
            titre=f"{_PHASE_TO_STR[phase]} – Séance publique",
            organe="PO78718",
            texte=texte,
            partie=partie,
        )
예제 #15
0
def find_examens_seance_publique(
    phase: Phase,
    entries: Iterable[element.Tag],
    textes: Dict[int, TexteRef],
    texte_examine: TexteRef,
    partie: Optional[int],
) -> List[LectureRef]:
    lecture_refs = list(
        find_amendements_seance_publique(phase, entries, textes, partie))
    if lecture_refs:
        return lecture_refs
    # default: séance publique will look at initial texte
    return [
        LectureRef(
            chambre=Chambre.SENAT,
            phase=phase,
            titre=f"{_PHASE_TO_STR[phase]} – Séance publique",
            organe="PO78718",
            texte=texte_examine,
            partie=partie,
        )
    ]
예제 #16
0
    def test_ppl18_229(self):
        """
        This one is tricky: renvoi en commission après séance publique

        There are two séance publique 1re lecture:
        - one on the initial texte
        - one on the new texte voted by the commission the 2nd time

        There are actually 2 commission lectures on the same initial texte,
        but with different URLs for amendements:
        - http://www.senat.fr/amendements/commissions/2018-2019/10229/liste_depot.html
        - http://www.senat.fr/amendements/commissions/2018-2019/229/liste_depot.html

        Looks like they created a fake texte with number 10229.

        TODO: find a way to represent both commission lectures.
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-229") == DossierRef(
            uid="ppl18-229",
            titre="Lutte contre l'habitat insalubre ou dangereux",
            slug="lutte-contre-habitat-insalubre-ou-dangereux",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-229.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2018X229",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=229,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2018, 12, 20),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2018X229",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=229,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2018, 12, 20),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X536",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=536,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 5, 29),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #17
0
def test_parse_dossier_essoc(dossier_essoc, textes):
    from zam_repondeur.models.chambre import Chambre
    from zam_repondeur.models.phase import Phase
    from zam_repondeur.services.fetch.an.dossiers.dossiers_legislatifs import (
        parse_dossier,
    )
    from zam_repondeur.services.fetch.an.dossiers.models import (
        DossierRef,
        LectureRef,
        TexteRef,
        TypeTexte,
    )

    lectures = [
        LectureRef(
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie au fond",
            phase=Phase.PREMIERE_LECTURE,
            texte=TexteRef(
                uid="PRJLANR5L15B0424",
                type_=TypeTexte.PROJET,
                chambre=Chambre.AN,
                legislature=15,
                numero=424,
                titre_long="projet de loi pour un Etat au service d’une société de confiance",  # noqa
                titre_court="Etat service société de confiance",
                date_depot=datetime.date(2017, 11, 27),
            ),
            organe="PO744107",
        ),
        LectureRef(
            chambre=Chambre.AN,
            titre="Première lecture – Séance publique",
            phase=Phase.PREMIERE_LECTURE,
            texte=TexteRef(
                uid="PRJLANR5L15BTC0575",
                type_=TypeTexte.PROJET,
                chambre=Chambre.AN,
                legislature=15,
                numero=575,
                titre_long="projet de loi sur le projet de loi, après engagement de la procédure accélérée, pour un Etat au service d’une société de confiance (n°424).",  # noqa
                titre_court="Etat service société de confiance",
                date_depot=datetime.date(2018, 1, 18),
            ),
            organe="PO717460",
        ),
        LectureRef(
            chambre=Chambre.SENAT,
            titre="Première lecture – Commission saisie au fond",
            phase=Phase.PREMIERE_LECTURE,
            texte=TexteRef(
                uid="PRJLSNR5S299B0259",
                type_=TypeTexte.PROJET,
                chambre=Chambre.SENAT,
                legislature=None,
                numero=259,
                titre_long="projet de loi pour un Etat au service d'une société de confiance",  # noqa
                titre_court="État au service d'une société de confiance",
                date_depot=datetime.date(2018, 1, 31),
            ),
            organe="PO748821",
        ),
        LectureRef(
            chambre=Chambre.SENAT,
            titre="Première lecture – Séance publique",
            phase=Phase.PREMIERE_LECTURE,
            texte=TexteRef(
                uid="PRJLSNR5S299BTC0330",
                type_=TypeTexte.PROJET,
                chambre=Chambre.SENAT,
                legislature=None,
                numero=330,
                titre_long="projet de loi  sur le projet de loi, adopté, par l'Assemblée nationale après engagement de la procédure accélérée, pour un Etat au service d'une société de confiance (n°259).",  # noqa
                titre_court="État au service d'une société de confiance",
                date_depot=datetime.date(2018, 2, 22),
            ),
            organe="PO78718",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.AN,
            titre="Nouvelle lecture – Commission saisie au fond",
            texte=TexteRef(
                uid="PRJLANR5L15B0806",
                type_=TypeTexte.PROJET,
                chambre=Chambre.AN,
                legislature=15,
                numero=806,
                titre_long="projet de loi renforçant l'efficacité de l'administration pour une relation de confiance avec le public",  # noqa
                titre_court="Renforcement de l'efficacité de l'administration pour une relation de confiance avec le public",  # noqa
                date_depot=datetime.date(2018, 3, 21),
            ),
            organe="PO744107",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.AN,
            titre="Nouvelle lecture – Séance publique",
            texte=TexteRef(
                uid="PRJLANR5L15BTC1056",
                type_=TypeTexte.PROJET,
                chambre=Chambre.AN,
                legislature=15,
                numero=1056,
                titre_long="projet de loi , en nouvelle lecture, sur le projet de loi, modifié par le Sénat, renforçant l'efficacité de l'administration pour une relation de confiance avec le public (n°806).",  # noqa
                titre_court="Etat au service d'une société de confiance",
                date_depot=datetime.date(2018, 6, 13),
            ),
            organe="PO717460",
        ),
    ]

    dossier = parse_dossier(dossier_essoc, textes)

    for lecture1, lecture2 in zip(dossier.lectures, lectures):
        assert lecture1 == lecture2

    assert dossier == DossierRef(
        uid="DLR5L15N36159",
        titre="Fonction publique : un Etat au service d'une société de confiance",
        slug="etat-service-societe-confiance",
        an_url="http://www.assemblee-nationale.fr/dyn/15/dossiers/alt/etat_service_societe_confiance",  # noqa
        senat_url="http://www.senat.fr/dossier-legislatif/pjl17-259.html",
        lectures=lectures,
    )
예제 #18
0
    def test_ppl18_002(self):
        """
        Première & nouvelle lecture
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("ppl18-002") == DossierRef(
            uid="ppl18-002",
            titre="Agence nationale de la cohésion des territoires",
            slug="agence-nationale-cohesion-territoires",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/ppl18-002.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2018X2",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=2,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2018, 10, 2),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2018X99",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=99,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2018, 10, 31),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.NOUVELLE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Nouvelle lecture – Commissions",
                    texte=TexteRef(
                        uid="PPLSENAT2019X518",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=518,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 5, 21),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.NOUVELLE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Nouvelle lecture – Séance publique",
                    texte=TexteRef(
                        uid="PPLSENAT2019X562",
                        type_=TypeTexte.PROPOSITION,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=562,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 6, 12),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #19
0
def test_parse_dossier_plfss_2018(dossier_plfss_2018, textes):
    from zam_repondeur.models.chambre import Chambre
    from zam_repondeur.models.phase import Phase
    from zam_repondeur.services.fetch.an.dossiers.dossiers_legislatifs import (
        parse_dossier,
    )
    from zam_repondeur.services.fetch.an.dossiers.models import (
        LectureRef,
        TexteRef,
        TypeTexte,
    )

    dossier = parse_dossier(dossier_plfss_2018, textes)

    assert dossier.uid == "DLR5L15N36030"
    assert dossier.titre == "Sécurité sociale : loi de financement 2018"
    texte_269 = TexteRef(
        uid="PRJLANR5L15B0269",
        type_=TypeTexte.PROJET,
        chambre=Chambre.AN,
        legislature=15,
        numero=269,
        titre_long="projet de loi de financement de la sécurité sociale pour 2018",  # noqa
        titre_court="PLFSS pour 2018",
        date_depot=datetime.date(2017, 10, 11),
    )
    texte_63 = TexteRef(
        uid="PRJLSNR5S299B0063",
        type_=TypeTexte.PROJET,
        chambre=Chambre.SENAT,
        legislature=None,
        numero=63,
        titre_long="projet de loi de financement de la sécurité sociale pour 2018",  # noqa
        titre_court="PLFSS pour 2018",
        date_depot=datetime.date(2017, 11, 6),
    )
    texte_387 = TexteRef(
        uid="PRJLANR5L15B0387",
        type_=TypeTexte.PROJET,
        chambre=Chambre.AN,
        legislature=15,
        numero=387,
        titre_long="projet de loi de financement de la sécurité sociale pour 2018",  # noqa
        titre_court="PLFSS pour 2018",
        date_depot=datetime.date(2017, 11, 21),
    )
    texte_121 = TexteRef(
        uid="PRJLSNR5S299B0121",
        type_=TypeTexte.PROJET,
        chambre=Chambre.SENAT,
        legislature=None,
        numero=121,
        titre_long="projet de loi de financement de la sécurité sociale pour 2018",  # noqa
        titre_court="PLFSS pour 2018",
        date_depot=datetime.date(2017, 11, 30),
    )
    texte_434 = TexteRef(
        uid="PRJLANR5L15B0434",
        type_=TypeTexte.PROJET,
        chambre=Chambre.AN,
        legislature=15,
        numero=434,
        titre_long="projet de loi de financement de la sécurité sociale pour 2018",  # noqa
        titre_court="PLFSS pour 2018",
        date_depot=datetime.date(2017, 12, 1),
    )
    assert dossier.lectures == [
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie au fond",
            texte=texte_269,
            organe="PO420120",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_269,
            organe="PO59048",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Séance publique",
            texte=texte_269,
            organe="PO717460",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Première lecture – Commission saisie au fond",
            texte=texte_63,
            organe="PO211493",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_63,
            organe="PO211494",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Première lecture – Séance publique",
            texte=texte_63,
            organe="PO78718",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.AN,
            titre="Nouvelle lecture – Commission saisie au fond",
            texte=texte_387,
            organe="PO420120",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.AN,
            titre="Nouvelle lecture – Séance publique",
            texte=texte_387,
            organe="PO717460",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Nouvelle lecture – Commission saisie au fond",
            texte=texte_121,
            organe="PO211493",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Nouvelle lecture – Séance publique",
            texte=texte_121,
            organe="PO78718",
        ),
        LectureRef(
            phase=Phase.LECTURE_DEFINITIVE,
            chambre=Chambre.AN,
            titre="Lecture définitive – Commission saisie au fond",
            texte=texte_434,
            organe="PO420120",
        ),
        LectureRef(
            phase=Phase.LECTURE_DEFINITIVE,
            chambre=Chambre.AN,
            titre="Lecture définitive – Séance publique",
            texte=texte_434,
            organe="PO717460",
        ),
    ]
예제 #20
0
    def test_plfss2020(self):
        """
        Projet de loi de financement de la sécurité sociale 2020 (27/11)
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("plfss2020") == DossierRef(
            uid="plfss2020",
            titre="Financement de la sécurité sociale pour 2020",
            slug="financement-securite-sociale-2020",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/plfss2020.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PLFSENAT2019X98",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=98,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 11, 4),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PLFSENAT2019X98",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=98,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 11, 4),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
                LectureRef(
                    chambre=Chambre.SENAT,
                    phase=Phase.NOUVELLE_LECTURE,
                    titre="Nouvelle lecture – Commissions",
                    texte=TexteRef(
                        uid="PLFSENAT2019X151",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=151,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 11, 27),
                    ),
                    organe="",
                    partie=None,
                ),
                LectureRef(
                    chambre=Chambre.SENAT,
                    phase=Phase.NOUVELLE_LECTURE,
                    titre="Nouvelle lecture – Séance publique",
                    texte=TexteRef(
                        uid="PLFSENAT2019X151",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=151,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 11, 27),
                    ),
                    organe="PO78718",
                    partie=None,
                ),
            ],
        )
예제 #21
0
    def test_pjlf2020(self):
        """
        Projet de loi de finances 2020 (27/11)
        """
        from zam_repondeur.models.chambre import Chambre
        from zam_repondeur.models.phase import Phase
        from zam_repondeur.services.fetch.an.dossiers.models import (
            DossierRef,
            LectureRef,
            TexteRef,
            TypeTexte,
        )
        from zam_repondeur.services.fetch.senat.scraping import create_dossier_ref

        assert create_dossier_ref("pjlf2020") == DossierRef(
            uid="pjlf2020",
            titre="Budget 2020",
            slug="budget-2020",
            an_url="",
            senat_url="https://www.senat.fr/dossier-legislatif/pjlf2020.html",
            lectures=[
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PJLSENAT2019X139",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=139,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 11, 21),
                    ),
                    organe="",
                    partie=1,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Commissions",
                    texte=TexteRef(
                        uid="PJLSENAT2019X139",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=139,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 11, 21),
                    ),
                    organe="",
                    partie=2,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PJLSENAT2019X139",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=139,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 11, 21),
                    ),
                    organe="PO78718",
                    partie=1,
                ),
                LectureRef(
                    phase=Phase.PREMIERE_LECTURE,
                    chambre=Chambre.SENAT,
                    titre="Première lecture – Séance publique",
                    texte=TexteRef(
                        uid="PJLSENAT2019X139",
                        type_=TypeTexte.PROJET,
                        chambre=Chambre.SENAT,
                        legislature=None,
                        numero=139,
                        titre_long="",
                        titre_court="",
                        date_depot=datetime.date(2019, 11, 21),
                    ),
                    organe="PO78718",
                    partie=2,
                ),
            ],
        )
예제 #22
0
파일: dossiers.py 프로젝트: betagouv/zam
def mock_dossiers():
    from zam_repondeur.models.chambre import Chambre
    from zam_repondeur.models.phase import Phase
    from zam_repondeur.services.fetch.an.dossiers.models import (
        DossierRef,
        LectureRef,
        TexteRef,
        TypeTexte,
    )

    with patch(
        "zam_repondeur.services.data.get_dossiers_legislatifs_and_textes"
    ) as m_dossiers:
        textes = {
            "PRJLANR5L15B0269": TexteRef(
                uid="PRJLANR5L15B0269",
                type_=TypeTexte.PROJET,
                chambre=Chambre.AN,
                legislature=15,
                numero=269,
                titre_long="projet de loi de financement de la sécurité sociale pour 2018",  # noqa
                titre_court="PLFSS pour 2018",
                date_depot=date(2017, 10, 11),
            ),
            "PRJLSNR5S299B0063": TexteRef(
                uid="PRJLSNR5S299B0063",
                type_=TypeTexte.PROJET,
                chambre=Chambre.SENAT,
                legislature=None,
                numero=63,
                titre_long="projet de loi de financement de la sécurité sociale pour 2018",  # noqa
                titre_court="PLFSS pour 2018",
                date_depot=date(2017, 11, 6),
            ),
            "PRJLANR5L15B0806": TexteRef(
                uid="PRJLANR5L15B0806",
                type_=TypeTexte.PROJET,
                chambre=Chambre.AN,
                legislature=15,
                numero=806,
                titre_long="projet de loi renforçant l'efficacité de l'administration pour une relation de confiance avec le public",  # noqa
                titre_court="Renforcement de l'efficacité de l'administration pour une relation de confiance avec le public",  # noqa
                date_depot=date(2018, 3, 21),
            ),
            "PRJLSNR5S319B0106": TexteRef(
                uid="PRJLSNR5S319B0106",
                type_=TypeTexte.PROJET,
                chambre=Chambre.SENAT,
                legislature=None,
                numero=106,
                titre_long="projet de loi de financement de la sécurité sociale pour 2019",  # noqa
                titre_court="PLFSS pour 2019",
                date_depot=date(2018, 11, 5),
            ),
            "PRJLANR5L15B1802": TexteRef(
                uid="PRJLANR5L15B1802",
                type_=TypeTexte.PROJET,
                chambre=Chambre.AN,
                legislature=15,
                numero=1802,
                titre_long="projet de loi de transformation de la fonction publique",  # noqa
                titre_court="Transformation de la fonction publique",
                date_depot=date(2019, 3, 27),
            ),
            "PRJLANR5L15BTC1924": TexteRef(
                uid="PRJLANR5L15BTC1924",
                type_=TypeTexte.PROJET,
                chambre=Chambre.AN,
                legislature=15,
                numero=1924,
                titre_long="projet de loi sur le projet de loi, après engagement de la procédure accélérée, de transformation de la fonction publique (n°1802).",  # noqa
                titre_court="Transformation de la fonction publique",
                date_depot=date(2019, 5, 3),
            ),
        }
        dossiers = {
            "DLR5L15N36030": DossierRef(
                uid="DLR5L15N36030",
                titre="Sécurité sociale : loi de financement 2018",
                slug="plfss-2018",
                an_url="http://www.assemblee-nationale.fr/dyn/15/dossiers/alt/plfss_2018",  # noqa
                senat_url="http://www.senat.fr/dossier-legislatif/plfss2018.html",
                lectures=[
                    LectureRef(
                        chambre=Chambre.AN,
                        titre="Première lecture – Titre lecture",
                        phase=Phase.PREMIERE_LECTURE,
                        texte=textes["PRJLANR5L15B0269"],
                        organe="PO717460",  # séance publique
                    ),
                    LectureRef(
                        chambre=Chambre.SENAT,
                        titre="Première lecture – Titre lecture",
                        phase=Phase.PREMIERE_LECTURE,
                        texte=textes["PRJLSNR5S299B0063"],
                        organe="PO78718",  # séance publique
                    ),
                    LectureRef(
                        chambre=Chambre.SENAT,
                        titre="Première lecture – Commission saisie au fond",
                        phase=Phase.PREMIERE_LECTURE,
                        texte=textes["PRJLSNR5S299B0063"],
                        organe="PO211493",
                    ),
                ],
            ),
            "DLR5L15N36159": DossierRef(
                uid="DLR5L15N36159",
                titre="Fonction publique : un Etat au service d'une société de confiance",  # noqa
                slug="etat-service-societe-confiance",
                an_url="http://www.assemblee-nationale.fr/dyn/15/dossiers/alt/etat_service_societe_confiance",  # noqa
                senat_url="http://www.senat.fr/dossier-legislatif/pjl17-259.html",
                lectures=[
                    LectureRef(
                        chambre=Chambre.AN,
                        phase=Phase.NOUVELLE_LECTURE,
                        titre="Nouvelle lecture – Titre lecture",
                        texte=textes["PRJLANR5L15B0806"],
                        organe="PO744107",  # commission spéciale
                    )
                ],
            ),
            "DLR5L15N36892": DossierRef(
                uid="DLR5L15N36892",
                titre="Sécurité sociale : loi de financement 2019",
                slug="plfss-2019",
                an_url="http://www.assemblee-nationale.fr/dyn/15/dossiers/alt/plfss_2019",  # noqa
                senat_url="http://www.senat.fr/dossier-legislatif/plfss2019.html",
                lectures=[
                    LectureRef(
                        chambre=Chambre.SENAT,
                        titre="Première lecture – Titre lecture",
                        phase=Phase.PREMIERE_LECTURE,
                        texte=textes["PRJLSNR5S319B0106"],
                        organe="PO78718",  # séance publique
                    )
                ],
            ),
            "DLR5L15N37357": DossierRef(
                uid="DLR5L15N37357",
                titre="Fonction publique : transformation de la fonction publique",
                slug="transformation-fonction-publique",
                an_url="http://www.assemblee-nationale.fr/dyn/15/dossiers/alt/transformation_fonction_publique",  # noqa
                senat_url="http://www.senat.fr/dossier-legislatif/pjl18-532.html",
                lectures=[
                    LectureRef(
                        chambre=Chambre.AN,
                        titre="Première lecture – Commission saisie au fond",
                        phase=Phase.PREMIERE_LECTURE,
                        texte=textes["PRJLANR5L15B1802"],
                        organe="PO59051",
                        partie=None,
                    ),
                    LectureRef(
                        chambre=Chambre.AN,
                        titre="Première lecture – Séance publique",
                        phase=Phase.PREMIERE_LECTURE,
                        texte=textes["PRJLANR5L15BTC1924"],
                        organe="PO717460",
                        partie=None,
                    ),
                    # Intentionnaly removed to check it merges with Senat scraped data.
                    # LectureRef(
                    #     chambre=Chambre.SENAT,
                    #     titre="Première lecture – Commission saisie au fond",
                    #     phase=Phase.PREMIERE_LECTURE,
                    #     texte=TexteRef(
                    #         uid="PRJLSNR5S319B0532",
                    #         type_=TypeTexte.PROJET,
                    #         chambre=Chambre.SENAT,
                    #         legislature=None,
                    #         numero=532,
                    #         titre_long="projet de loi de transformation de la fonction publique",  # noqa
                    #         titre_court="Transformation de la fonction publique",
                    #         date_depot=date(2019, 5, 29),
                    #     ),
                    #     organe="PO211495",
                    #     partie=None,
                    # ),
                ],
            ),
        }
        m_dossiers.return_value = dossiers, textes
        yield
예제 #23
0
def test_parse_dossier_plf_2018(dossier_plf_2018, textes):
    from zam_repondeur.models.chambre import Chambre
    from zam_repondeur.models.phase import Phase
    from zam_repondeur.services.fetch.an.dossiers.dossiers_legislatifs import (
        parse_dossier,
    )
    from zam_repondeur.services.fetch.an.dossiers.models import (
        LectureRef,
        TexteRef,
        TypeTexte,
    )

    dossier = parse_dossier(dossier_plf_2018, textes)

    assert dossier.uid == "DLR5L15N35854"
    assert dossier.titre == "Budget : loi de finances 2018"
    texte_235 = TexteRef(
        uid="PRJLANR5L15B0235",
        type_=TypeTexte.PROJET,
        chambre=Chambre.AN,
        legislature=15,
        numero=235,
        titre_long="projet de loi de finances pour 2018",
        titre_court="PLF pour 2018",
        date_depot=datetime.date(2017, 9, 27),
    )
    texte_107 = TexteRef(
        uid="PRJLSNR5S299B0107",
        type_=TypeTexte.PROJET,
        chambre=Chambre.SENAT,
        legislature=None,
        numero=107,
        titre_long="projet de loi de finances pour 2018",
        titre_court="PLF pour 2018",
        date_depot=datetime.date(2017, 11, 23),
    )
    texte_485 = TexteRef(
        uid="PRJLANR5L15B0485",
        type_=TypeTexte.PROJET,
        chambre=Chambre.AN,
        legislature=15,
        numero=485,
        titre_long="projet de loi de finances pour 2018",
        titre_court="PLF pour 2018",
        date_depot=datetime.date(2017, 12, 12),
    )
    texte_172 = TexteRef(
        uid="PRJLSNR5S299B0172",
        type_=TypeTexte.PROJET,
        chambre=Chambre.SENAT,
        legislature=None,
        numero=172,
        titre_long="projet de loi de finances pour 2018",
        titre_court="PLF pour 2018",
        date_depot=datetime.date(2017, 12, 18),
    )
    texte_506 = TexteRef(
        uid="PRJLANR5L15B0506",
        type_=TypeTexte.PROJET,
        chambre=Chambre.AN,
        legislature=15,
        numero=506,
        titre_long="projet de loi de finances pour 2018",
        titre_court="PLF pour 2018",
        date_depot=datetime.date(2017, 12, 19),
    )
    assert dossier.lectures == [
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie au fond",
            texte=texte_235,
            partie=1,
            organe="PO59048",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie au fond",
            texte=texte_235,
            partie=2,
            organe="PO59048",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=1,
            organe="PO420120",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=2,
            organe="PO420120",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=1,
            organe="PO419604",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=2,
            organe="PO419604",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=1,
            organe="PO419610",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=2,
            organe="PO419610",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=1,
            organe="PO59047",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=2,
            organe="PO59047",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=1,
            organe="PO59046",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=2,
            organe="PO59046",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=1,
            organe="PO59051",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=2,
            organe="PO59051",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=1,
            organe="PO419865",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Commission saisie pour avis",
            texte=texte_235,
            partie=2,
            organe="PO419865",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Séance publique",
            texte=texte_235,
            partie=1,
            organe="PO717460",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.AN,
            titre="Première lecture – Séance publique",
            texte=texte_235,
            partie=2,
            organe="PO717460",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Première lecture – Commission saisie au fond",
            texte=texte_107,
            partie=1,
            organe="PO211494",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Première lecture – Commission saisie au fond",
            texte=texte_107,
            partie=2,
            organe="PO211494",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Première lecture – Séance publique",
            texte=texte_107,
            partie=1,
            organe="PO78718",
        ),
        LectureRef(
            phase=Phase.PREMIERE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Première lecture – Séance publique",
            texte=texte_107,
            partie=2,
            organe="PO78718",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.AN,
            titre="Nouvelle lecture – Commission saisie au fond",
            texte=texte_485,
            organe="PO59048",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.AN,
            titre="Nouvelle lecture – Séance publique",
            texte=texte_485,
            organe="PO717460",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Nouvelle lecture – Commission saisie au fond",
            texte=texte_172,
            organe="PO211494",
        ),
        LectureRef(
            phase=Phase.NOUVELLE_LECTURE,
            chambre=Chambre.SENAT,
            titre="Nouvelle lecture – Séance publique",
            texte=texte_172,
            organe="PO78718",
        ),
        LectureRef(
            phase=Phase.LECTURE_DEFINITIVE,
            chambre=Chambre.AN,
            titre="Lecture définitive – Commission saisie au fond",
            texte=texte_506,
            organe="PO59048",
        ),
        LectureRef(
            phase=Phase.LECTURE_DEFINITIVE,
            chambre=Chambre.AN,
            titre="Lecture définitive – Séance publique",
            texte=texte_506,
            organe="PO717460",
        ),
    ]