Skip to content
Snippets Groups Projects
test_en.py 561 B
Newer Older
from src.detectors.date.en import detect_dates_en

def test_detect_dates_en():
    # Check en-us
    text = "On 1.01.2022, I sold my cat. On April 5, 2021, I bought a dog."
    found_dates = detect_dates_en(text)
    
    assert found_dates == [(3,12,"1.01.2022"), (32,45, "April 5, 2021")]
    
    # Check en-gb
    # TODO: Following test fails. Fix it.
    # text = "On 1.01.2022 I sold the cat. On 5th April 2021 I bought a dog."
    # found_dates = detect_dates_en(text)
    
    # assert found_dates == [(3,12,"1.01.2022"), (32,46, "5th April 2021")]