本文整理汇总了Python中taxcalc.Policy.read_json_reform_file方法的典型用法代码示例。如果您正苦于以下问题:Python Policy.read_json_reform_file方法的具体用法?Python Policy.read_json_reform_file怎么用?Python Policy.read_json_reform_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类taxcalc.Policy
的用法示例。
在下文中一共展示了Policy.read_json_reform_file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_read_json_reform_file_and_implement_reform_b
# 需要导入模块: from taxcalc import Policy [as 别名]
# 或者: from taxcalc.Policy import read_json_reform_file [as 别名]
def test_read_json_reform_file_and_implement_reform_b(reform_file):
"""
Test reading and translation of reform file into a reform dictionary
that is then used to call implement_reform method.
NOTE: implement_reform called when policy.current_year > policy.start_year
"""
reform = Policy.read_json_reform_file(reform_file.name)
policy = Policy()
policy.set_year(2015) # the only difference between this and prior test
policy.implement_reform(reform)
syr = policy.start_year
amt_tthd = policy._AMT_tthd
assert amt_tthd[2015 - syr] == 200000
assert amt_tthd[2016 - syr] > 200000
assert amt_tthd[2017 - syr] == 300000
assert amt_tthd[2018 - syr] > 300000
ii_em = policy._II_em
assert ii_em[2016 - syr] == 6000
assert ii_em[2017 - syr] == 6000
assert ii_em[2018 - syr] == 7500
assert ii_em[2019 - syr] > 7500
assert ii_em[2020 - syr] == 9000
assert ii_em[2021 - syr] > 9000
amt_em = policy._AMT_em
assert amt_em[2016 - syr, 0] > amt_em[2015 - syr, 0]
assert amt_em[2017 - syr, 0] > amt_em[2016 - syr, 0]
assert amt_em[2018 - syr, 0] == amt_em[2017 - syr, 0]
assert amt_em[2019 - syr, 0] == amt_em[2017 - syr, 0]
assert amt_em[2020 - syr, 0] == amt_em[2017 - syr, 0]
assert amt_em[2021 - syr, 0] > amt_em[2020 - syr, 0]
assert amt_em[2022 - syr, 0] > amt_em[2021 - syr, 0]
示例2: test_read_json_reform_file_and_implement_reform
# 需要导入模块: from taxcalc import Policy [as 别名]
# 或者: from taxcalc.Policy import read_json_reform_file [as 别名]
def test_read_json_reform_file_and_implement_reform(reform_file, set_year):
"""
Test reading and translation of reform file into a reform dictionary
that is then used to call implement_reform method.
NOTE: implement_reform called when policy.current_year == policy.start_year
"""
reform = Policy.read_json_reform_file(reform_file.name)
policy = Policy()
if set_year:
policy.set_year(2015)
policy.implement_reform(reform)
syr = policy.start_year
amt_brk1 = policy._AMT_brk1
assert amt_brk1[2015 - syr] == 200000
assert amt_brk1[2016 - syr] > 200000
assert amt_brk1[2017 - syr] == 300000
assert amt_brk1[2018 - syr] > 300000
ii_em = policy._II_em
assert ii_em[2016 - syr] == 6000
assert ii_em[2017 - syr] == 6000
assert ii_em[2018 - syr] == 7500
assert ii_em[2019 - syr] > 7500
assert ii_em[2020 - syr] == 9000
assert ii_em[2021 - syr] > 9000
amt_em = policy._AMT_em
assert amt_em[2016 - syr, 0] > amt_em[2015 - syr, 0]
assert amt_em[2017 - syr, 0] > amt_em[2016 - syr, 0]
assert amt_em[2018 - syr, 0] == amt_em[2017 - syr, 0]
assert amt_em[2019 - syr, 0] == amt_em[2017 - syr, 0]
assert amt_em[2020 - syr, 0] == amt_em[2017 - syr, 0]
assert amt_em[2021 - syr, 0] > amt_em[2020 - syr, 0]
assert amt_em[2022 - syr, 0] > amt_em[2021 - syr, 0]
add4aged = policy._ID_Medical_frt_add4aged
assert add4aged[2015 - syr] == -0.025
assert add4aged[2016 - syr] == -0.025
assert add4aged[2017 - syr] == 0.0
assert add4aged[2022 - syr] == 0.0
示例3: test_read_bad_json_reform_file
# 需要导入模块: from taxcalc import Policy [as 别名]
# 或者: from taxcalc.Policy import read_json_reform_file [as 别名]
def test_read_bad_json_reform_file(badreformfile):
with pytest.raises(ValueError):
Policy.read_json_reform_file(badreformfile.name)