Skip to content

Commit

Permalink
TST: Check DatetimeIndex.drop on DST boundary
Browse files Browse the repository at this point in the history
Closes gh-18031.
  • Loading branch information
gfyoung committed Aug 3, 2018
1 parent 35dd15b commit 8128341
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pandas/tests/indexes/datetimes/test_timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,28 @@ def test_iteration_preserves_nanoseconds(self, tz):
for i, ts in enumerate(index):
assert ts == index[i]

def test_drop_dst_boundary(self):
# see gh-18031
tz = "Europe/Brussels"
freq = "15min"

start = pd.Timestamp("201710290100", tz=tz)
end = pd.Timestamp("201710290300", tz=tz)
index = pd.date_range(start=start, end=end, freq=freq)

expected = DatetimeIndex(["201710290115", "201710290130",
"201710290145", "201710290200",
"201710290215", "201710290230",
"201710290245", "201710290200",
"201710290215", "201710290230",
"201710290245", "201710290300"],
tz=tz, freq=freq,
ambiguous=[True, True, True, True,
True, True, True, False,
False, False, False, False])
result = index.drop(index[0])
tm.assert_index_equal(result, expected)


class TestDateRange(object):
"""Tests for date_range with timezones"""
Expand Down

0 comments on commit 8128341

Please sign in to comment.