-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #933 from PolicyEngine/chore/test_private_school_vat
Add tests to `private_school_vat` and `attends_private_school`
- Loading branch information
Showing
4 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- bump: patch | ||
changes: | ||
added: | ||
- Test suite for private_school_vat | ||
- Test suite for attends_private_school | ||
removed: | ||
- Unnecessary print statement in winter_fuel_allowance |
63 changes: 63 additions & 0 deletions
63
policyengine_uk/tests/policy/baseline/contrib/labour/attends_private_school.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
- name: Attends private school returns True when attendance rate is 100% | ||
period: 2024 | ||
input: | ||
gov.simulation.private_school_vat.private_school_attendance_rate.100: 1 | ||
gov.simulation.private_school_vat.private_school_attendance_rate.95: 1 | ||
people: | ||
adult: | ||
age: 25 | ||
child: | ||
age: 10 | ||
households: | ||
household: | ||
household_weight: 0.001 | ||
household_market_income: 1_000_000_000 | ||
household_benefits: 0 | ||
members: [ | ||
adult, | ||
child | ||
] | ||
output: | ||
attends_private_school: [False, True] | ||
|
||
- name: Attends private school returns False when attendance rate is 0% | ||
period: 2024 | ||
input: | ||
gov.simulation.private_school_vat.private_school_attendance_rate.100: 0 | ||
gov.simulation.private_school_vat.private_school_attendance_rate.95: 0 | ||
people: | ||
adult: | ||
age: 25 | ||
child: | ||
age: 10 | ||
households: | ||
household: | ||
household_weight: 0.001 | ||
household_market_income: 1_000_000_000 | ||
household_benefits: 0 | ||
members: [ | ||
adult, | ||
child | ||
] | ||
output: | ||
attends_private_school: [False, False] | ||
|
||
- name: Attends private school successfully returns False when household weights are 0 | ||
period: 2024 | ||
input: | ||
people: | ||
adult: | ||
age: 25 | ||
child: | ||
age: 10 | ||
households: | ||
household: | ||
household_weight: 0 | ||
household_market_income: 1_000_000_000 | ||
household_benefits: 0 | ||
members: [ | ||
adult, | ||
child | ||
] | ||
output: | ||
attends_private_school: [False, False] |
65 changes: 65 additions & 0 deletions
65
policyengine_uk/tests/policy/baseline/contrib/labour/private_school_vat.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
- name: Returns 0 when no children | ||
period: 2024 | ||
input: | ||
# Set private school VAT rate to 25% to ensure correct testing | ||
gov.contrib.labour.private_school_vat: 0.25 | ||
people: | ||
adult: | ||
age: 25 | ||
households: | ||
household: | ||
members: [ | ||
adult, | ||
] | ||
output: | ||
private_school_vat: 0 | ||
|
||
- name: Returns correctly with one child | ||
period: 2024 | ||
input: | ||
# Set private school VAT rate to 25% to ensure correct testing | ||
gov.contrib.labour.private_school_vat: 0.25 | ||
# Override other default settings for easier testing | ||
gov.simulation.private_school_vat.private_school_vat_basis: 1 | ||
gov.simulation.private_school_vat.private_school_fees: 10_000 | ||
people: | ||
adult: | ||
age: 25 | ||
child: | ||
age: 10 | ||
attends_private_school: True | ||
households: | ||
household: | ||
members: [ | ||
adult, | ||
child | ||
] | ||
output: | ||
private_school_vat: 2_500 | ||
|
||
- name: Returns correct value with 2+ children | ||
period: 2024 | ||
input: | ||
# Set private school VAT rate to 25% to ensure correct testing | ||
gov.contrib.labour.private_school_vat: 0.25 | ||
# Override other default settings for easier testing | ||
gov.simulation.private_school_vat.private_school_vat_basis: 1 | ||
gov.simulation.private_school_vat.private_school_fees: 10_000 | ||
people: | ||
adult: | ||
age: 25 | ||
child1: | ||
age: 10 | ||
attends_private_school: True | ||
child2: | ||
age: 12 | ||
attends_private_school: True | ||
households: | ||
household: | ||
members: [ | ||
adult, | ||
child1, | ||
child2 | ||
] | ||
output: | ||
private_school_vat: 5_000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters