Example #1
0
def test_get_D_ss(budget_balance, expected_tuple):
    '''
    Test of the fiscla.get_D_ss() function.
    '''
    r_gov = 0.03
    Y = 1.176255339
    p = Specifications()
    p.debt_ratio_ss = 1.2
    p.budget_balance = budget_balance
    p.g_n_ss = 0.02
    test_tuple = fiscal.get_D_ss(r_gov, Y, p)

    for i, v in enumerate(test_tuple):
        assert np.allclose(v, expected_tuple[i])
Example #2
0
def test_get_G_ss(budget_balance, expected_G):
    '''
    Test of the fiscla.get_G_ss() function.
    '''
    Y = 2.2
    net_revenue = 2.3
    pension_amount = 0.0
    TR = 1.6
    UBI = 0.0
    new_borrowing = 0.072076633
    debt_service = 0.042345192
    p = Specifications()
    p.budget_balance = budget_balance
    test_G = fiscal.get_G_ss(Y, net_revenue, pension_amount, TR, UBI,
                             new_borrowing, debt_service, p)

    assert np.allclose(test_G, expected_G)
Example #3
0
def test_get_TR(baseline, budget_balance, baseline_spending, method,
                expected_TR):
    '''
    Test of the fiscal.get_TR() function.
    '''
    Y = 3.2
    TR = 1.5
    G = 0.0
    agg_pension_outlays = 0.0
    UBI_outlays = 0.0
    total_tax_revenue = 1.9
    p = Specifications(baseline=baseline)
    p.budget_balance = budget_balance
    p.baseline_spending = baseline_spending
    if method == 'TPI':
        Y = np.ones(p.T * p.S) * Y
        TR = np.ones(p.T * p.S) * TR
        total_tax_revenue = np.ones(p.T * p.S) * total_tax_revenue
    test_TR = fiscal.get_TR(Y, TR, G, total_tax_revenue, agg_pension_outlays,
                            UBI_outlays, p, method)

    assert np.allclose(test_TR, expected_TR)