def test_dti_add_offset_tzaware(self):
    dates = date_range('2012-11-01', periods=3, tz='US/Pacific')
    offset = (dates + pd.offsets.Hour(5))
    assert ((dates[0] + pd.offsets.Hour(5)) == offset[0])
    for tz in ['UTC', 'US/Pacific', 'Asia/Tokyo']:
        dates = date_range('2010-11-01 00:00', periods=3, tz=tz, freq='H')
        expected = DatetimeIndex(['2010-11-01 05:00', '2010-11-01 06:00', '2010-11-01 07:00'], freq='H', tz=tz)
        offset = (dates + pd.offsets.Hour(5))
        tm.assert_index_equal(offset, expected)
        offset = (dates + np.timedelta64(5, 'h'))
        tm.assert_index_equal(offset, expected)
        offset = (dates + timedelta(hours=5))
        tm.assert_index_equal(offset, expected)
def test_dti_add_offset_tzaware(self):
    dates = date_range('2012-11-01', periods=3, tz='US/Pacific')
    offset = (dates + pd.offsets.Hour(5))
    assert ((dates[0] + pd.offsets.Hour(5)) == offset[0])
    for tz in ['UTC', 'US/Pacific', 'Asia/Tokyo']:
        dates = date_range('2010-11-01 00:00', periods=3, tz=tz, freq='H')
        expected = DatetimeIndex(['2010-11-01 05:00', '2010-11-01 06:00', '2010-11-01 07:00'], freq='H', tz=tz)
        offset = (dates + pd.offsets.Hour(5))
        tm.assert_index_equal(offset, expected)
        offset = (dates + np.timedelta64(5, 'h'))
        tm.assert_index_equal(offset, expected)
        offset = (dates + timedelta(hours=5))
        tm.assert_index_equal(offset, expected)