-
Notifications
You must be signed in to change notification settings - Fork 14
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 #72 from andersonfrailey/clitest
Add CLI Tests
- Loading branch information
Showing
3 changed files
with
40 additions
and
2 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
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 |
---|---|---|
|
@@ -109,6 +109,7 @@ def test_convert_adj(): | |
} | ||
} | ||
|
||
|
||
def test_convert_adj_w_index(): | ||
adj = { | ||
"ACTC_c": [ | ||
|
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,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) |