Spaces:
Sleeping

app / tests /test_date_parser.py
CarlChaaya's picture
Super-squash branch 'main' using huggingface_hub
69d639b
Raw History Blame Contribute Delete
546 Bytes
from datetime import date
from opportunity_tracker.date_parser import extract_closing_date, extract_dates, extract_publish_date
def test_extracts_dayfirst_dates() -> None:
assert extract_dates("Closing: 15/06/2026") == [date(2026, 6, 15)]
def test_extracts_labeled_closing_date() -> None:
assert extract_closing_date("Tender ABC closing date: 31 May 2026") == date(2026, 5, 31)
def test_extracts_arabic_digit_publish_date() -> None:
assert extract_publish_date("تاريخ النشر: ٠٦/٠٥/٢٠٢٦") == date(2026, 5, 6)