Skip to content

Commit

Permalink
Update parser_tests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JBKahn committed Sep 10, 2019
1 parent d856efa commit 45d12d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/parser_tests.py
Expand Up @@ -224,6 +224,12 @@ def test_parse_timestamp(self):
self.parser.parse("{:f}123456".format(float_timestamp), "X"), self.expected
)

negative_timestamp = -1565358758
self.expected = datetime.fromtimestamp(negative_timestamp, tz=tz_utc)
self.assertEqual(
self.parser.parse("{:d}".format(negative_timestamp), "X"), self.expected
)

# NOTE: timestamps cannot be parsed from natural language strings (by removing the ^...$) because it will
# break cases like "15 Jul 2000" and a format list (see issue #447)
with self.assertRaises(ParserError):
Expand Down

0 comments on commit 45d12d4

Please sign in to comment.