Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainipp committed Jan 10, 2025
1 parent 624665f commit da5ad56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openfisca_france/model/prestations/minima_sociaux/ppa.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def formula(famille, period, parameters):
rsa_majore_eligibilite = famille('rsa_majore_eligibilite', period)
rsa_condition_nationalite_i = famille.members('rsa_condition_nationalite', period)
rsa_condition_nationalite = famille.any(rsa_condition_nationalite_i)
condition_nationalite = (rsa_condition_nationalite + ppa_majore_eligibilite) > 0
condition_nationalite = (rsa_condition_nationalite + rsa_majore_eligibilite) > 0

return condition_age * condition_nationalite

Expand Down
9 changes: 9 additions & 0 deletions tests/formulas/rsa/rsa_condition_nationalite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@
output:
ressortissant_eee: [true, true, false, false, false]
rsa_condition_nationalite: [false, true, true, false, true]

- period: 2018-06
input:
age: [20, 17, 19, 20, 20, 20]
nationalite: [DE, DE, CH, NZ, NZ, MA]
duree_possession_titre_sejour: [0.2, 0.25, 0.25, 4.9, 5, 4.8]
output:
ressortissant_eee: [true, true, false, false, false, false]
ppa_eligibilite: [false, false, true, false, true, false]

0 comments on commit da5ad56

Please sign in to comment.