feat: add us-cpa return model and calculations
This commit is contained in:
48
skills/us-cpa/tests/test_returns.py
Normal file
48
skills/us-cpa/tests/test_returns.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
|
||||
from us_cpa.returns import normalize_case_facts, resolve_required_forms, tax_on_ordinary_income
|
||||
|
||||
|
||||
class ReturnModelTests(unittest.TestCase):
|
||||
def test_normalize_case_facts_computes_basic_1040_totals(self) -> None:
|
||||
normalized = normalize_case_facts(
|
||||
{
|
||||
"taxpayer.fullName": "Jane Doe",
|
||||
"filingStatus": "single",
|
||||
"wages": 50000,
|
||||
"taxableInterest": 100,
|
||||
"federalWithholding": 6000,
|
||||
},
|
||||
2025,
|
||||
)
|
||||
|
||||
self.assertEqual(normalized["requiredForms"], ["f1040"])
|
||||
self.assertEqual(normalized["deductions"]["standardDeduction"], 15750.0)
|
||||
self.assertEqual(normalized["totals"]["adjustedGrossIncome"], 50100.0)
|
||||
self.assertEqual(normalized["totals"]["taxableIncome"], 34350.0)
|
||||
self.assertEqual(normalized["totals"]["refund"], 2116.5)
|
||||
|
||||
def test_resolve_required_forms_adds_business_and_interest_forms(self) -> None:
|
||||
normalized = normalize_case_facts(
|
||||
{
|
||||
"filingStatus": "single",
|
||||
"wages": 0,
|
||||
"taxableInterest": 2000,
|
||||
"businessIncome": 12000,
|
||||
},
|
||||
2025,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
resolve_required_forms(normalized),
|
||||
["f1040", "f1040sb", "f1040sc", "f1040se", "f1040s1"],
|
||||
)
|
||||
|
||||
def test_tax_bracket_calculation_uses_2025_single_rates(self) -> None:
|
||||
self.assertEqual(tax_on_ordinary_income(34350.0, "single"), 3883.5)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user