Skip to content

Commit

Permalink
TST: Check DatetimeIndex.drop on DST boundary (pandas-dev#22165)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored and victor committed Sep 30, 2018
1 parent 548b4ba commit affb5ee
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 @@ -738,6 +738,28 @@ def test_dti_drop_dont_lose_tz(self):

assert ind.tz is not None

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)

def test_date_range_localize(self):
rng = date_range('3/11/2012 03:00', periods=15, freq='H',
tz='US/Eastern')
Expand Down

0 comments on commit affb5ee

Please sign in to comment.