Commit 3316f271 authored by Yohan Boniface's avatar Yohan Boniface

Add Auvergne-Rhône-Alpes rules

parent 45425608
......@@ -12,6 +12,7 @@ from roll.extensions import traceback
from trefle.api import app as trefleapp
from trefle.config import FINANCEMENTS
pytestmark = pytest.mark.asyncio
......@@ -112,7 +113,7 @@ async def test_simulate_endpoint_filter_eligible(client):
resp = await client.post('/financement', body=body)
assert resp.status == HTTPStatus.OK
financements = json.loads(resp.body)['financements']
assert len(financements) == 26
assert len(financements) == len(FINANCEMENTS)
# Filter eligible only
resp = await client.post('/financement?eligible=true', body=body)
assert resp.status == HTTPStatus.OK
......@@ -124,7 +125,7 @@ async def test_simulate_endpoint_filter_eligible(client):
resp = await client.post('/financement?eligible=false', body=body)
assert resp.status == HTTPStatus.OK
financements = json.loads(resp.body)['financements']
assert len(financements) == 24
assert len(financements) == len(FINANCEMENTS) - 2
for financement in financements:
assert financement['eligible'] is False
......@@ -144,7 +145,7 @@ async def test_simulate_endpoint_filter_tags(client):
resp = await client.post('/financement', body=body)
assert resp.status == HTTPStatus.OK
financements = json.loads(resp.body)['financements']
assert len(financements) == 26
assert len(financements) == len(FINANCEMENTS)
# Filter CPF only
resp = await client.post('/financement?tags=CPF', body=body)
assert resp.status == HTTPStatus.OK
......@@ -169,7 +170,7 @@ async def test_simulate_endpoint_mix_filters(client):
resp = await client.post('/financement', body=body)
assert resp.status == HTTPStatus.OK
financements = json.loads(resp.body)['financements']
assert len(financements) == 26
assert len(financements) == len(FINANCEMENTS)
# Filter CPF only
resp = await client.post('/financement?tags=hors%20temps%20de%20travail'
'&eligible=1', body=body)
......@@ -193,7 +194,7 @@ async def test_simulate_hors_temps_de_travail(client):
resp = await client.post('/financement', body=body)
assert resp.status == HTTPStatus.OK
financements = json.loads(resp.body)['financements']
assert len(financements) == 26
assert len(financements) == len(FINANCEMENTS)
# Filter eligible only
resp = await client.post('/financement?tags=hors%20temps%20de%20travail'
'&eligible=1', body=body)
......
......@@ -59,9 +59,11 @@ def test_isfloat(input, expected):
@pytest.mark.parametrize('input,expected', [
('AGEFOS PME', 'agefospme'),
('Agefos PME', 'agefospme'),
('AgéfosPME', 'agefospme'),
('AGEFOS PME', 'AGEFOSPME'),
('Agefos PME', 'AGEFOSPME'),