Skip to content

Commit 2fde995

Browse files
committed
Added tests for parsing 0 durations.
1 parent 6d7625f commit 2fde995

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_parsing.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ def test_parse_duration():
8686
assert isinstance(duration, pendulum.Duration)
8787
assert_duration(duration, 0, 0, 2, 0, 0, 0, 0)
8888

89+
text = "PT0S"
90+
91+
duration = pendulum.parse(text)
92+
93+
assert isinstance(duration, pendulum.Duration)
94+
assert_duration(duration, 0, 0, 0, 0, 0, 0, 0)
95+
96+
text = "P0D"
97+
98+
duration = pendulum.parse(text)
99+
100+
assert isinstance(duration, pendulum.Duration)
101+
assert_duration(duration, 0, 0, 0, 0, 0, 0, 0)
102+
89103

90104
def test_parse_interval():
91105
text = "2008-05-11T15:30:00Z/P1Y2M10DT2H30M"

0 commit comments

Comments
 (0)