Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard Token Recognized in .get() #1104

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/test_parser.py
Expand Up @@ -1305,6 +1305,13 @@ def test_iso8601_basic_format(self):
2018, 5, 17, 10, 55, 13, tzinfo=tz.tzoffset(None, -25200)
)

#wildcard token tests
assert self.parser.parse_iso("2018**17") == datetime(2018, "**", 17)
assert self.parser.parse_iso("****0127") == datetime("****", 1, 27)
assert self.parser.parse_iso("102909**") == datetime(1029, 9,"*")
assert self.parser.parse_iso("2022****") == datetime(2022, "**","*")


# ordinal in basic format: YYYYDDDD
assert self.parser.parse_iso("1998136") == datetime(1998, 5, 16)

Expand All @@ -1322,6 +1329,7 @@ def test_iso8601_basic_format(self):
# too many digits in time
with pytest.raises(ParserError):
self.parser.parse_iso("20180517T1055213Z")


def test_midnight_end_day(self):
assert self.parser.parse_iso("2019-10-30T24:00:00") == datetime(
Expand Down