Skip to content

Commit 261da67

Browse files
ischwabachergouthambs
authored andcommitted
TST: Add tests for to_offset with leading zeroes
Test for the issues fixed by cbc8c73.
1 parent 31c50bf commit 261da67

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tseries/tests/test_frequencies.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ def test_to_offset_negative():
7272
freqstr = '-5min10s'
7373
result = to_offset(freqstr)
7474
assert(result.n == -310)
75+
76+
77+
def test_to_offset_leading_zero():
78+
freqstr = '00H 00T 01S'
79+
result = to_offset(freqstr)
80+
assert(result.n == 1)
81+
82+
freqstr = '-00H 03T 14S'
83+
result = to_offset(freqstr)
84+
assert(result.n == -194)
7585

7686

7787
def test_anchored_shortcuts():

0 commit comments

Comments
 (0)