Example #1
0
def test_isodate() -> None:
    test_string = "2011-09-22"
    result = atdate.parse(test_string)
    assert result == datetime(2011, 9, 22, 3, 4, 5, 0)
Example #2
0
def test_at_midnight_year_change():
    test_string = 'midnight'
    result = atdate.parse(test_string)
    assert result == datetime(2001, 1, 1, 0, 0, 0, 0)
Example #3
0
def test_at_now_next_minutes():
    test_string = 'now next minutes'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 2, 3, 5, 5, 0)
Example #4
0
def test_wallclock_hour_minute_am_pm():
    test_string = '02:01 pm'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 7, 2, 14, 1, 0, 0)
Example #5
0
def test_at_noon_year_change():
    test_string = 'noon'
    result = atdate.parse(test_string)
    assert result == datetime(2001, 1, 1, 12, 0, 0, 0)
Example #6
0
def test_parse_return_datetime_object():
    test_string = 'noon'
    result = atdate.parse(test_string)
    assert isinstance(result, datetime)
Example #7
0
def test_inc_period():
    test_string = '02.07.2000 +1days'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 7, 3, 3, 4, 5, 0)
Example #8
0
def test_at_midnight_year_change() -> None:
    test_string = "midnight"
    result = atdate.parse(test_string)
    assert result == datetime(2001, 1, 1, 0, 0, 0, 0)
Example #9
0
def test_at_now() -> None:
    test_string = "now"
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 2, 3, 4, 5, 0)
Example #10
0
def test_at_noon_year_change() -> None:
    test_string = "noon"
    result = atdate.parse(test_string)
    assert result == datetime(2001, 1, 1, 12, 0, 0, 0)
Example #11
0
def test_at_midnight() -> None:
    test_string = "midnight"
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 3, 0, 0, 0, 0)
Example #12
0
def test_at_noon_after_noon() -> None:
    test_string = "noon"
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 3, 12, 0, 0, 0)
Example #13
0
def test_isodatetime_without_t() -> None:
    test_string = "2011-09-22 11:44"
    result = atdate.parse(test_string)
    assert result == datetime(2011, 9, 22, 11, 44, 0, 0)
Example #14
0
def test_time_date() -> None:
    test_string = "12:24 01.02.2011"
    result = atdate.parse(test_string)
    assert result == datetime(2011, 2, 1, 12, 24, 0, 0)
Example #15
0
def test_at_now_next_year():
    test_string = 'now next year'
    result = atdate.parse(test_string)
    assert result == datetime(2001, 1, 2, 3, 4, 5, 0)
Example #16
0
def test_at_now_next_minute_change_hour() -> None:
    test_string = "now next minute"
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 2, 4, 0, 5, 0)
Example #17
0
def test_month_name_day_number():
    test_string = 'May 20'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 5, 20, 3, 4, 5, 0)
Example #18
0
def test_next_month_without_now():
    test_string = 'next month'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 8, 2, 3, 4, 5, 0)
Example #19
0
def test_day_number_month_number_year_number():
    test_string = '20.05.2003'
    result = atdate.parse(test_string)
    assert result == datetime(2003, 5, 20, 3, 4, 5, 0)
Example #20
0
def test_plus_one_day_without_now():
    test_string = '+1days'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 7, 3, 3, 4, 5, 0)
Example #21
0
def test_hr24clock_hour_minute():
    test_string = '14:01'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 7, 2, 14, 1, 0, 0)
Example #22
0
def test_at_now_next_hour():
    test_string = 'now next hour'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 2, 4, 4, 5, 0)
Example #23
0
def test_at_noon_after_noon():
    test_string = 'noon'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 3, 12, 0, 0, 0)
Example #24
0
def test_at_now_next_day():
    test_string = 'now next day'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 3, 3, 4, 5, 0)
Example #25
0
def test_at_midnight():
    test_string = 'midnight'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 3, 0, 0, 0, 0)
Example #26
0
def test_at_now_next_week():
    test_string = 'now next week'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 9, 3, 4, 5, 0)
Example #27
0
def test_at_now():
    test_string = 'now'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 2, 3, 4, 5, 0)
Example #28
0
def test_at_now_next_month():
    test_string = 'now next month'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 2, 2, 3, 4, 5, 0)
Example #29
0
def test_at_now_next_minute_change_day():
    test_string = 'now next minute'
    result = atdate.parse(test_string)
    assert result == datetime(2000, 1, 3, 0, 0, 5, 0)
Example #30
0
def test_wallclock_hr_min_am_pm() -> None:
    test_string = "0201 pm"
    result = atdate.parse(test_string)
    assert result == datetime(2000, 7, 2, 14, 1, 0, 0)