当前位置: 首页>>代码示例>>Python>>正文


Python Policy.read_json_reform_file方法代码示例

本文整理汇总了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]
开发者ID:chrisrytting,项目名称:Tax-Calculator,代码行数:33,代码来源:test_policy.py

示例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
开发者ID:kerkphil,项目名称:Tax-Calculator,代码行数:39,代码来源:test_policy.py

示例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)
开发者ID:akshaya-trivedi,项目名称:Tax-Calculator,代码行数:5,代码来源:test_policy.py


注:本文中的taxcalc.Policy.read_json_reform_file方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。