-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit main py files and add unit tests
- Loading branch information
1 parent
53d7db2
commit aad4007
Showing
14 changed files
with
357 additions
and
261 deletions.
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
3 changes: 2 additions & 1 deletion
3
...ed_childcare_entitlement/hour_by_age.yaml → ...targeted_childcare_entitlement/hours.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
File renamed without changes.
File renamed without changes.
154 changes: 154 additions & 0 deletions
154
...ine_uk/tests/policy/baseline/gov/dwp/targeted_childcare_entitlement/combine_benefits.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,154 @@ | ||
- name: Eligible with JSA - couple | ||
period: 2025 | ||
input: | ||
people: | ||
adult1: | ||
total_income: 10000 | ||
social_security_income: 0 | ||
adult2: | ||
total_income: 5000 | ||
social_security_income: 0 | ||
benunits: | ||
benunit: | ||
members: ["adult1", "adult2"] | ||
jsa_income: 100 | ||
esa_income: 0 | ||
universal_credit: 0 | ||
is_guarantee_credit_eligible: false | ||
child_tax_credit: 0 | ||
working_tax_credit: 0 | ||
output: | ||
targeted_childcare_entitlement_meets_benefits: [true] | ||
|
||
- name: Eligible with UC under income threshold - family | ||
period: 2025 | ||
input: | ||
people: | ||
parent: | ||
total_income: 15000 | ||
social_security_income: 5000 # Makes adjusted income = 10000 | ||
child: | ||
total_income: 0 | ||
social_security_income: 0 | ||
benunits: | ||
benunit: | ||
members: ["parent", "child"] | ||
jsa_income: 0 | ||
esa_income: 0 | ||
universal_credit: 100 | ||
is_guarantee_credit_eligible: false | ||
child_tax_credit: 0 | ||
working_tax_credit: 0 | ||
output: | ||
targeted_childcare_entitlement_meets_benefits: [true] | ||
|
||
- name: Eligible with tax credits under income threshold - large family | ||
period: 2025 | ||
input: | ||
people: | ||
parent1: | ||
total_income: 10000 | ||
social_security_income: 0 | ||
parent2: | ||
total_income: 6000 | ||
social_security_income: 0 | ||
child1: | ||
total_income: 0 | ||
social_security_income: 0 | ||
child2: | ||
total_income: 0 | ||
social_security_income: 0 | ||
benunits: | ||
benunit: | ||
members: ["parent1", "parent2", "child1", "child2"] | ||
jsa_income: 0 | ||
esa_income: 0 | ||
universal_credit: 0 | ||
is_guarantee_credit_eligible: false | ||
child_tax_credit: 100 | ||
working_tax_credit: 0 | ||
output: | ||
targeted_childcare_entitlement_meets_benefits: [true] | ||
|
||
- name: Ineligible due to high income with UC | ||
period: 2025 | ||
input: | ||
people: | ||
adult1: | ||
total_income: 250000 | ||
benunits: | ||
benunit: | ||
members: ["adult1"] | ||
universal_credit: 10000 | ||
jsa_income: 0 | ||
output: | ||
targeted_childcare_entitlement_meets_benefits: [false] | ||
|
||
- name: Ineligible with no qualifying benefits - family | ||
period: 2025 | ||
input: | ||
people: | ||
parent: | ||
total_income: 10000 | ||
social_security_income: 0 | ||
child1: | ||
total_income: 0 | ||
social_security_income: 0 | ||
child2: | ||
total_income: 0 | ||
social_security_income: 0 | ||
benunits: | ||
benunit: | ||
members: ["parent", "child1", "child2"] | ||
jsa_income: 0 | ||
esa_income: 0 | ||
universal_credit: 0 | ||
is_guarantee_credit_eligible: false | ||
child_tax_credit: 0 | ||
working_tax_credit: 0 | ||
output: | ||
targeted_childcare_entitlement_meets_benefits: [false] | ||
|
||
- name: Eligible with ESA - couple | ||
period: 2025 | ||
input: | ||
people: | ||
adult1: | ||
total_income: 8000 | ||
social_security_income: 0 | ||
adult2: | ||
total_income: 7000 | ||
social_security_income: 0 | ||
benunits: | ||
benunit: | ||
members: ["adult1", "adult2"] | ||
jsa_income: 0 | ||
esa_income: 100 | ||
universal_credit: 0 | ||
is_guarantee_credit_eligible: false | ||
child_tax_credit: 0 | ||
working_tax_credit: 0 | ||
output: | ||
targeted_childcare_entitlement_meets_benefits: [true] | ||
|
||
- name: Eligible with pension credit - couple | ||
period: 2025 | ||
input: | ||
people: | ||
adult1: | ||
total_income: 8000 | ||
social_security_income: 0 | ||
adult2: | ||
total_income: 7000 | ||
social_security_income: 0 | ||
benunits: | ||
benunit: | ||
members: ["adult1", "adult2"] | ||
jsa_income: 0 | ||
esa_income: 0 | ||
universal_credit: 0 | ||
is_guarantee_credit_eligible: true | ||
child_tax_credit: 0 | ||
working_tax_credit: 0 | ||
output: | ||
targeted_childcare_entitlement_meets_benefits: [true] |
77 changes: 77 additions & 0 deletions
77
policyengine_uk/tests/policy/baseline/gov/dwp/targeted_childcare_entitlement/funding.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,77 @@ | ||
- name: Child aged 2 with benefits eligibility | ||
period: 2024 | ||
input: | ||
people: | ||
child: | ||
age: 2 | ||
targeted_childcare_entitlement_hours: 570 | ||
benunits: | ||
benunit: | ||
members: ["child"] | ||
output: | ||
targeted_childcare_entitlement: [4719.60] | ||
|
||
- name: Child aged 3 not eligible | ||
period: 2024 | ||
input: | ||
people: | ||
child: | ||
age: 3 | ||
targeted_childcare_entitlement_hours: 0 | ||
benunits: | ||
benunit: | ||
members: ["child"] | ||
output: | ||
targeted_childcare_entitlement: [0] | ||
|
||
- name: Child aged 4 not eligible | ||
period: 2024 | ||
input: | ||
people: | ||
child: | ||
age: 4 | ||
targeted_childcare_entitlement_hours: 0 | ||
benunits: | ||
benunit: | ||
members: ["child"] | ||
output: | ||
targeted_childcare_entitlement: [0] | ||
|
||
- name: Multiple children different ages | ||
period: 2024 | ||
input: | ||
people: | ||
parent: | ||
age: 35 | ||
child1: | ||
age: 2 | ||
targeted_childcare_entitlement_hours: 570 | ||
child2: | ||
age: 3 | ||
targeted_childcare_entitlement_hours: 0 | ||
child3: | ||
age: 4 | ||
targeted_childcare_entitlement_hours: 0 | ||
benunits: | ||
benunit: | ||
members: ["parent", "child1", "child2", "child3"] | ||
output: | ||
targeted_childcare_entitlement: [0, 4719.60, 0, 0] | ||
|
||
- name: Family with twins both age 2 | ||
period: 2024 | ||
input: | ||
people: | ||
parent: | ||
age: 35 | ||
twin1: | ||
age: 2 | ||
targeted_childcare_entitlement_hours: 570 | ||
twin2: | ||
age: 2 | ||
targeted_childcare_entitlement_hours: 570 | ||
benunits: | ||
benunit: | ||
members: ["parent", "twin1", "twin2"] | ||
output: | ||
targeted_childcare_entitlement: [0, 4719.60, 4719.60] |
70 changes: 70 additions & 0 deletions
70
policyengine_uk/tests/policy/baseline/gov/dwp/targeted_childcare_entitlement/hours.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,70 @@ | ||
- name: fully eligible | ||
period: 2025 | ||
input: | ||
people: | ||
child: | ||
age: 2 | ||
benunits: | ||
benunit: | ||
members: ["child"] | ||
targeted_childcare_entitlement_meets_benefits: true | ||
output: | ||
targeted_childcare_entitlement_hours: [570] | ||
|
||
- name: not eligible due to benefits | ||
period: 2025 | ||
input: | ||
people: | ||
child: | ||
age: 2 | ||
benunits: | ||
benunit: | ||
members: ["child"] | ||
targeted_childcare_entitlement_meets_benefits: false | ||
output: | ||
targeted_childcare_entitlement_hours: [0] | ||
|
||
- name: not eligible due to age | ||
period: 2025 | ||
input: | ||
people: | ||
child: | ||
age: 3 | ||
benunits: | ||
benunit: | ||
members: ["child"] | ||
targeted_childcare_entitlement_meets_benefits: true | ||
output: | ||
targeted_childcare_entitlement_hours: [0] | ||
|
||
- name: multiple children with mixed eligibility | ||
period: 2025 | ||
input: | ||
people: | ||
child1: | ||
age: 2 | ||
child2: | ||
age: 3 | ||
child3: | ||
age: 4 | ||
benunits: | ||
benunit: | ||
members: ["child1", "child2", "child3"] | ||
targeted_childcare_entitlement_meets_benefits: true | ||
output: | ||
targeted_childcare_entitlement_hours: [570, 0, 0] | ||
|
||
- name: family with twins both eligible | ||
period: 2025 | ||
input: | ||
people: | ||
twin1: | ||
age: 2 | ||
twin2: | ||
age: 2 | ||
benunits: | ||
benunit: | ||
members: ["twin1", "twin2"] | ||
targeted_childcare_entitlement_meets_benefits: true | ||
output: | ||
targeted_childcare_entitlement_hours: [570, 570] |
Oops, something went wrong.