From e780bc425cb4431823fb2f1e722b104a6215085a Mon Sep 17 00:00:00 2001 From: jdebacker Date: Wed, 6 Mar 2024 09:47:55 -0500 Subject: [PATCH] update tests to specifcy year --- ccc/tests/test_calcfunctions.py | 2 +- ccc/tests/test_calculator.py | 2 +- ccc/tests/test_parameters.py | 2 +- ccc/tests/test_run_ccc.py | 2 +- cs-config/cs_config/tests/test_functions.py | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ccc/tests/test_calcfunctions.py b/ccc/tests/test_calcfunctions.py index 4c6c7f0d..521403e2 100644 --- a/ccc/tests/test_calcfunctions.py +++ b/ccc/tests/test_calcfunctions.py @@ -10,7 +10,7 @@ def test_update_depr_methods(monkeypatch): """ Test of calcfunctions.update_depr_methods """ - p = Specification() + p = Specification(year=2020) json_str = """ {"schema": { "labels": { diff --git a/ccc/tests/test_calculator.py b/ccc/tests/test_calculator.py index 22d87448..f893c755 100644 --- a/ccc/tests/test_calculator.py +++ b/ccc/tests/test_calculator.py @@ -330,7 +330,7 @@ def test_restore_assets(): def test_p_param_return_value(): assets = Assets() - p = Specification() + p = Specification(year=2022) dp = DepreciationParams() calc1 = Calculator(p, dp, assets) obj = calc1.p_param("tau_int") diff --git a/ccc/tests/test_parameters.py b/ccc/tests/test_parameters.py index 31edb049..cf00ebb3 100644 --- a/ccc/tests/test_parameters.py +++ b/ccc/tests/test_parameters.py @@ -76,7 +76,7 @@ def test_update_specification_with_json(): def test_update_bad_revision1(): - spec = Specification() + spec = Specification(year=2022) # profit rate has an upper bound at 1.0 revs = {"profit_rate": [{"year": spec.year, "value": 1.2}]} spec.update_specification(revs, raise_errors=False) diff --git a/ccc/tests/test_run_ccc.py b/ccc/tests/test_run_ccc.py index 14940cdc..5ab347f6 100644 --- a/ccc/tests/test_run_ccc.py +++ b/ccc/tests/test_run_ccc.py @@ -19,7 +19,7 @@ def test_calc_by_methods(): comparing actual and expect dataframes """ # execute Calculator calc_by methods to get actual results - p = Specification() + p = Specification(year=2022) dp = DepreciationParams() assets = Assets() calc = Calculator(p, dp, assets) diff --git a/cs-config/cs_config/tests/test_functions.py b/cs-config/cs_config/tests/test_functions.py index d04219bf..39be1638 100644 --- a/cs-config/cs_config/tests/test_functions.py +++ b/cs-config/cs_config/tests/test_functions.py @@ -3,6 +3,7 @@ import numpy as np import io from cs_config import functions +from ccc.utils import DEFAULT_START_YEAR def test_start_year_with_data_source(): @@ -47,10 +48,10 @@ class TestFunctions1(CoreTestFunctions): run_model = functions.run_model ok_adjustment = { "Business Tax Parameters": { - "CIT_rate": [{"year": 2022, "value": 0.25}] + "CIT_rate": [{"year": DEFAULT_START_YEAR, "value": 0.25}] }, "Individual and Payroll Tax Parameters": { - "FICA_ss_trt": [{"year": 2022, "value": 0.14}] + "FICA_ss_trt": [{"year": DEFAULT_START_YEAR, "value": 0.14}] }, } bad_adjustment = {