Esempio n. 1
0
def test_fetch_amendement_not_found():
    from zam_repondeur.fetch.an.amendements import fetch_amendement, NotFound

    responses.add(responses.GET, build_url(14, 4072, 177), status=404)

    with pytest.raises(NotFound):
        fetch_amendement(
            legislature=14,
            texte=4072,
            numero=177,
            organe="PO717460",
            groups_folder=SAMPLE_DATA_DIR,
            position=1,
        )
Esempio n. 2
0
def test_fetch_amendement(app):
    from zam_repondeur.fetch.an.amendements import fetch_amendement
    from zam_repondeur.fetch.models import Amendement

    responses.add(
        responses.GET,
        build_url(14, 4072, 177),
        body=read_sample_data("an_177.xml"),
        status=200,
    )

    amendement = fetch_amendement(
        legislature=14,
        texte=4072,
        numero=177,
        organe="PO717460",
        groups_folder=SAMPLE_DATA_DIR,
        position=1,
    )

    assert amendement == Amendement(
        chambre="an",
        session="14",
        num_texte=4072,
        organe="PO717460",
        subdiv_type="article",
        subdiv_num="3",
        subdiv_mult="",
        subdiv_pos="",
        alinea="",
        num=177,
        rectif=0,
        auteur="Door Jean-Pierre",
        matricule="267289",
        groupe="Les Républicains",
        date_depot=None,
        sort="rejeté",
        position=1,
        discussion_commune=None,
        identique=None,
        parent_num=0,
        parent_rectif=0,
        dispositif="<p>Supprimer cet article.</p>",
        objet=
        "<p>Amendement d&#8217;appel.</p>\n<p>Pour couvrir les d&#233;passements attendus de l&#8217;ONDAM pour 2016, cet article pr&#233;voit un pr&#233;l&#232;vement de 200 millions d&#8217;&#8364; sur les fonds de roulement de l&#8217;association nationale pour la formation permanente du personnel hospitalier (ANFH) et du fonds pour l&#8217;emploi hospitalier (FEH) pour financer le <span>fonds pour la modernisation des &#233;tablissements de sant&#233; publics et priv&#233;s</span>(FMESPP) en remplacement de cr&#233;dit de l&#8217;ONDAM. Il participe donc &#224; la pr&#233;sentation insinc&#232;re de la construction de l&#8217;ONDAM, d&#233;nonc&#233;e par le Comit&#233; d&#8217;alerte le 12 octobre dernier.</p>",  # noqa
        resume=None,
        avis=None,
        observations=None,
        reponse=None,
    )
    assert amendement.parent is None
Esempio n. 3
0
def test_fetch_amendement_sort_nil():
    from zam_repondeur.fetch.an.amendements import fetch_amendement

    responses.add(
        responses.GET,
        build_url(14, 4072, 38),
        body=read_sample_data("an_38.xml"),
        status=200,
    )

    amendement = fetch_amendement(
        legislature=14,
        texte=4072,
        numero=38,
        organe="PO717460",
        groups_folder=SAMPLE_DATA_DIR,
        position=1,
    )

    assert amendement.sort == ""
Esempio n. 4
0
def test_fetch_amendement_gouvernement():
    from zam_repondeur.fetch.an.amendements import fetch_amendement

    responses.add(
        responses.GET,
        build_url(14, 4072, 723),
        body=read_sample_data("an_723.xml"),
        status=200,
    )

    amendement = fetch_amendement(
        legislature=14,
        texte=4072,
        numero=723,
        organe="PO717460",
        groups_folder=SAMPLE_DATA_DIR,
        position=1,
    )

    assert amendement.gouvernemental is True
    assert amendement.groupe == ""
Esempio n. 5
0
def test_fetch_sous_amendement(app):
    from zam_repondeur.fetch.an.amendements import fetch_amendement

    responses.add(
        responses.GET,
        build_url(14, 4072, 941),
        body=read_sample_data("an_941.xml"),
        status=200,
    )

    amendement = fetch_amendement(
        legislature=14,
        texte=4072,
        numero=941,
        organe="PO717460",
        groups_folder=SAMPLE_DATA_DIR,
        position=1,
    )

    assert amendement.parent_num == 155
    assert amendement.parent_rectif == 0
Esempio n. 6
0
def test_fetch_amendement_commission():
    from zam_repondeur.fetch.an.amendements import fetch_amendement

    responses.add(
        responses.GET,
        build_url(14, 4072, 135),
        body=read_sample_data("an_135.xml"),
        status=200,
    )

    amendement = fetch_amendement(
        legislature=14,
        texte=4072,
        numero=135,
        organe="PO717460",
        groups_folder=SAMPLE_DATA_DIR,
        position=1,
    )

    assert amendement.gouvernemental is False
    assert amendement.auteur == "Bapt Gérard"
    assert amendement.groupe == ""
Esempio n. 7
0
def test_fetch_amendement_apres():
    from zam_repondeur.fetch.an.amendements import fetch_amendement

    responses.add(
        responses.GET,
        build_url(14, 4072, 192),
        body=read_sample_data("an_192.xml"),
        status=200,
    )

    amendement = fetch_amendement(
        legislature=14,
        texte=4072,
        numero=192,
        organe="PO717460",
        groups_folder=SAMPLE_DATA_DIR,
        position=1,
    )

    assert amendement.subdiv_type == "article"
    assert amendement.subdiv_num == "8"
    assert amendement.subdiv_mult == ""
    assert amendement.subdiv_pos == "apres"