2025-01-20 10:24:00 +00:00
|
|
|
from datetime import date, timedelta
|
|
|
|
|
|
2025-03-07 10:11:22 +00:00
|
|
|
from .issue import parse_and_update_date_received, create_body
|
2025-01-20 10:24:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
If no further actions are taken, the proposal may be set by the facilitators to `WITHDRAWN` on 2026-02-08 (in 1 year).
|
|
|
|
|
"""
|
|
|
|
|
)
|