1
0
mirror of https://codeberg.org/fediverse/fep.git synced 2026-08-05 11:46:04 +00:00
Files
fep/scripts/tools/test_issue.py
T

44 lines
1.1 KiB
Python
Raw Normal View History

from datetime import date, timedelta
2025-03-07 10:11:22 +00:00
from .issue import parse_and_update_date_received, create_body
def test_parse_and_update_date_received():
today = date.today()
result = parse_and_update_date_received(today.isoformat())
assert result == today
def test_parse_and_update_date_received_parse_error():
today = date.today()
result = parse_and_update_date_received("incorrect")
assert result == today
def test_parse_and_update_date_received_outdated():
today = date.today()
result = parse_and_update_date_received((today - timedelta(days=60)).isoformat())
assert result == today
2025-03-07 10:11:22 +00:00
def test_create_body():
result = create_body("fep-0000.md", date(2025, 2, 8))
assert (
result
== """
The [proposal](https://codeberg.org/fediverse/fep/src/branch/main/fep-0000.md) has been received. Thank you!
This issue tracks discussions and updates to the proposal during the `DRAFT` period.
Please post links to relevant discussions as comments to this issue.
`dateReceived`: 2025-02-08
2025-06-24 15:43:41 +02:00
If no further actions are taken, the proposal will be set by the facilitators to `WITHDRAWN` on 2027-02-08 (in 2 years).
2025-03-07 10:11:22 +00:00
"""
)