def test_parse_date_raise_numeric(): with pytest.raises(TypeError): Calendar.parse_date(123)
def test_parse_date_raise_boolean(): with pytest.raises(TypeError): Calendar.parse_date(True)
def test_parse_date_datetime(): assert Calendar.parse_date(datetime.datetime(2019, 1, 1)) == datetime.date( 2019, 1, 1)
def test_parse_date_str_datetime(): assert Calendar.parse_date("2019-01-06T10:30:00") == datetime.date( 2019, 1, 6)
def test_parse_date_str_date_iso(): assert Calendar.parse_date("2019-01-06") == datetime.date(2019, 1, 6)
def test_parse_date_str_date(): assert Calendar.parse_date("Jan 1st, 2019") == datetime.date(2019, 1, 1)