mirror of
https://codeberg.org/fediverse/fep.git
synced 2026-08-05 19:55:46 +00:00
25 lines
609 B
Python
25 lines
609 B
Python
|
|
from datetime import date, timedelta
|
||
|
|
|
||
|
|
from .issue import parse_and_update_date_received
|
||
|
|
|
||
|
|
|
||
|
|
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
|