Skip to content

Commit

Permalink
Merge pull request #72 from andersonfrailey/clitest
Browse files Browse the repository at this point in the history
Add CLI Tests
  • Loading branch information
andersonfrailey authored Jul 24, 2019
2 parents 64a314e + cb046b6 commit d2265e4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
5 changes: 3 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Tax-Brain Release History

## 2019-xx-xx Release x.x.x
## 2019-07-24 Release 2.3.0

Last Merged Pull Request: [#68](https://github.com/PSLmodels/Tax-Brain/pull/68)
Last Merged Pull Request: [#72](https://github.com/PSLmodels/Tax-Brain/pull/72)

Changes in this release:

Expand All @@ -17,6 +17,7 @@ Changes in this release:
than current law ([#64](https://github.com/PSLmodels/Tax-Brain/pull/64))
* Update COMP table outputs so they are more readable ([#66](https://github.com/PSLmodels/Tax-Brain/pull/66))
* Add TaxBrain command line interface ([#67](https://github.com/PSLmodels/Tax-Brain/pull/67), [#68](https://github.com/PSLmodels/Tax-Brain/pull/68))
* Add automated report capabilities ([#69](https://github.com/PSLmodels/Tax-Brain/pull/69))

## 2019-05-24 Release 2.2.1

Expand Down
1 change: 1 addition & 0 deletions compconfig/compconfig/tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def test_convert_adj():
}
}


def test_convert_adj_w_index():
adj = {
"ACTC_c": [
Expand Down
36 changes: 36 additions & 0 deletions taxbrain/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import shutil
from taxbrain import cli_core
from pathlib import Path


def test_cli():
"""
Test core logic of the CLI
"""
startyear = 2019
endyear = 2020
data = None
usecps = True
reform = None
behavior = None
assump = None
baseline = None
outdir = ""
name = "test_cli"
make_report = False
author = None
cli_core(
startyear, endyear, data, usecps, reform, behavior, assump, baseline,
outdir, name, make_report, author
)
outpath = Path(outdir, name)
# assert that all folders and files have been created
assert outpath.is_dir()
assert Path(outpath, "aggregate_tax_liability.csv").exists()
for year in range(startyear, endyear + 1):
yearpath = Path(outpath, str(year))
assert yearpath.is_dir()
assert Path(yearpath, f"distribution_table_base_{year}.csv").exists()
assert Path(yearpath, f"distribution_table_reform_{year}.csv").exists()
assert Path(yearpath, f"differences_table_{year}.csv").exists()
shutil.rmtree(outpath)

0 comments on commit d2265e4

Please sign in to comment.