示例#1
0
def test_normalize_date_aggressively_ignores_fake_dates():
    assert normalize_date_aggressively('0000') is None
示例#2
0
def test_normalize_date_aggressively_raises_on_wrong_format():
    with pytest.raises(ValueError):
        normalize_date_aggressively('2014=12-01')
示例#3
0
def test_normalize_date_aggressively_strips_wrong_day():
    assert normalize_date_aggressively('2015-02-31') == '2015-02'
示例#4
0
def test_normalize_date_aggressively_strips_wrong_month():
    assert normalize_date_aggressively('2015-20-24') == '2015'
示例#5
0
def test_normalize_date_aggressively_accepts_correct_date():
    assert normalize_date_aggressively('2015-02-24') == '2015-02-24'