Also add the confirmation kit implementation plan. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
604 B
Python
21 lines
604 B
Python
from app.services.oa_confirmation_date import add_months_ymd
|
|
|
|
|
|
def test_simple_month_add():
|
|
assert add_months_ymd("2026-01-15", 3) == "2026-04-15"
|
|
|
|
|
|
def test_clamp_end_of_month():
|
|
assert add_months_ymd("2026-01-31", 1) == "2026-02-28"
|
|
|
|
|
|
def test_zero_months_returns_same_day():
|
|
assert add_months_ymd("2026-07-30", 0) == "2026-07-30"
|
|
|
|
|
|
def test_invalid_returns_none():
|
|
assert add_months_ymd("", 3) is None
|
|
assert add_months_ymd("2026-01-15", -1) is None
|
|
assert add_months_ymd("2026-01-15", True) is None # type: ignore[arg-type]
|
|
assert add_months_ymd("2026-02-30", 1) is None
|