Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniformize tests with the new API #18

Merged
merged 3 commits into from
Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,78 @@
# Changelog

### 1.2.0 - [#18](https://github.com/openfisca/extension-template/pull/18)

* Technical change
* Details:
- Adapt to OpenFisca Core v25
- Change the syntax of OpenFisca YAML tests

For instance, a test that was using the `input_variables` and the `output_variables` keywords like:

```yaml
- name: Basic income
period: 2016-12
input_variables:
salary: 1200
output_variables:
basic_income: 600
```

becomes:

```yaml
- name: Basic income
period: 2016-12
input:
salary: 1200
output:
basic_income: 600
```

A test that was fully specifying its entities like:

```yaml
- name: "A couple with 2 children gets 200€"
period: 2016-01
households:
parents: ["parent1", "parent2"]
children: ["child1", "child2"]
persons:
- id: "parent1"
age: 35
- id: "parent2"
age: 35
- id: "child1"
age: 8
- id: "child2"
age: 4
output_variables:
local_town_child_allowance: 200
```

becomes:

```yaml
- name: "A couple with 2 children gets 200€"
period: 2016-01
input:
households:
household:
parents: ["parent1", "parent2"]
children: ["child1", "child2"]
persons:
parent1:
age: 35
parent2:
age: 35
child1:
age: 8
child2:
age: 4
output:
local_town_child_allowance: 200
```

### 1.1.7 - [#16](https://github.com/openfisca/extension-template/pull/16)

* Technical change
Expand Down
46 changes: 25 additions & 21 deletions openfisca_extension_template/tests/local_benefit.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
- name: "A couple with 2 children gets 200€"
period: 2016-01
households:
parents: ["parent1", "parent2"]
children: ["child1", "child2"]
persons:
- id: "parent1"
age: 35
- id: "parent2"
age: 35
- id: "child1"
age: 8
- id: "child2"
age: 4
output_variables:
input:
households:
household:
parents: ["parent1", "parent2"]
children: ["child1", "child2"]
persons:
parent1:
age: 35
parent2:
age: 35
child1:
age: 8
child2:
age: 4
output:
local_town_child_allowance: 200

- name: "A couple with no child gets nothing"
period: 2016-01
households:
parents: ["parent1", "parent2"]
persons:
- id: "parent1"
age: 35
- id: "parent2"
age: 35
output_variables:
input:
households:
household:
parents: ["parent1", "parent2"]
persons:
parent1:
age: 35
parent2:
age: 35
output:
local_town_child_allowance: 0

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="OpenFisca-Extension-Template",
version="1.1.7",
version="1.2.0",
author="OpenFisca Team",
author_email = '[email protected]',
classifiers=[
Expand All @@ -22,7 +22,7 @@
("share/openfisca/openfisca-extension-template", ["CHANGELOG.md", "LICENSE", "README.md"]),
],
install_requires = [
"OpenFisca-Country-Template >= 3, < 4",
"OpenFisca-Country-Template >= 3.6.0, < 4",
],
extras_require = {
"dev": [
Expand Down