Skip to content

Commit

Permalink
Merge pull request #2564 from hdoupe/fix-json-test
Browse files Browse the repository at this point in the history
Update read invalid JSON file to read from an existing invalid file
  • Loading branch information
MattHJensen committed Mar 1, 2021
2 parents 7d9c619 + b12e698 commit d6c2763
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions taxcalc/tests/test_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,20 @@ def test_bad_json_names(tests_path):
"""
Test that ValueError raised with assump or reform do not end in '.json'
"""
test_url = (
'https://raw.githubusercontent.com/PSLmodels/'
'Tax-Calculator/master/taxcalc/reforms/'
'2017_law.out.csv'
)
csvname = os.path.join(tests_path, '..', 'growfactors.csv')
with pytest.raises(ValueError):
Calculator.read_json_param_objects(csvname, None)
with pytest.raises(FileNotFoundError):
Calculator.read_json_param_objects('http://name.json.html', None)
with pytest.raises(ValueError):
Calculator.read_json_param_objects(test_url, None)
with pytest.raises(ValueError):
Calculator.read_json_param_objects(None, csvname)
with pytest.raises(FileNotFoundError):
Calculator.read_json_param_objects(None, 'http://name.json.html')
with pytest.raises(ValueError):
Calculator.read_json_param_objects(None, test_url)


def test_json_assump_url():
Expand Down

0 comments on commit d6c2763

Please sign in to comment.