test: add us-cpa module coverage and citations
This commit is contained in:
25
skills/us-cpa/tests/test_tax_years.py
Normal file
25
skills/us-cpa/tests/test_tax_years.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
|
||||
from us_cpa.tax_years import supported_tax_years, tax_year_rules
|
||||
|
||||
|
||||
class TaxYearRuleTests(unittest.TestCase):
|
||||
def test_supported_years_are_listed(self) -> None:
|
||||
self.assertEqual(supported_tax_years(), [2024, 2025])
|
||||
|
||||
def test_tax_year_rules_include_source_citations(self) -> None:
|
||||
rules = tax_year_rules(2025)
|
||||
|
||||
self.assertIn("sourceCitations", rules)
|
||||
self.assertIn("standardDeduction", rules["sourceCitations"])
|
||||
self.assertIn("ordinaryIncomeBrackets", rules["sourceCitations"])
|
||||
|
||||
def test_unsupported_tax_year_raises_clear_error(self) -> None:
|
||||
with self.assertRaisesRegex(ValueError, "Unsupported tax year 2023"):
|
||||
tax_year_rules(2023)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user