def parse_datetime_can_parse_date(): dt = _parse_partial_datetime('2010-07-01') assert (dt == PartialDateTime(2010, 7, 1))
def parse_datetime_can_parse_year_month(): dt = _parse_partial_datetime('2010-07') print(dt) assert (dt == PartialDateTime(2010, 7))
def parse_datetime_raises_error_if_too_many_date_components(): dt = _parse_partial_datetime('2010-10-05-06')
def parse_datetime_raises_error_if_invalid_month(): dt = _parse_partial_datetime('2010-13')
def parse_datetime_can_parse_date_hour_min_sec_no_leading_zeros(): dt = _parse_partial_datetime('2010-3-4T5:6:7') assert (dt == PartialDateTime(2010, 3, 4, 5, 6, 7))
def parse_datetime_raises_error_if_invalid_character_in_year(): dt = _parse_partial_datetime('2X10')
def parse_datetime_raises_error_if_time_but_incomplete_date(): dt = _parse_partial_datetime('2010-10T12:00')
def parse_datetime_can_parse_date_time_with_colon_separator(): dt = _parse_partial_datetime('2010-07-01:13:27:43') assert (dt == PartialDateTime(2010, 7, 1, 13, 27, 43))
def parse_datetime_can_parse_date_hour_min_sec(): dt = _parse_partial_datetime('2010-07-01T13:27:43') assert (dt == PartialDateTime(2010, 7, 1, 13, 27, 43))
def parse_datetime_can_parse_date_hour(): dt = _parse_partial_datetime('2010-07-01T13') assert (dt == PartialDateTime(2010, 7, 1, 13))
def parse_datetime_raises_error_if_too_many_time_components(): dt = _parse_partial_datetime('2010-10-05T12:01:02:03')
def parse_datetime_raises_error_if_invalid_day(): dt = _parse_partial_datetime('2010-06-31')
def parse_datetime_can_parse_year(): dt = _parse_partial_datetime('2010') assert (dt == PartialDateTime(2010))