Skip to content

Commit 04c8457

Browse files
Chang Shewesm
Chang She
authored andcommitted
TST: equality of timestamps with diff time zones #1260
1 parent f48513a commit 04c8457

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tseries/tests/test_timezones.py

+13
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import nose
99

1010
import numpy as np
11+
import pytz
1112

1213
from pandas import (Index, Series, TimeSeries, DataFrame, isnull,
1314
date_range, Timestamp)
@@ -317,6 +318,18 @@ def test_intersection(self):
317318
result = left.intersection(right)
318319
self.assert_(result.tz == left.tz)
319320

321+
def test_tz_timestamp_eq(self):
322+
dt = datetime.today()
323+
utc = lib.Timestamp(dt, tz=pytz.timezone('UTC'))
324+
for z in pytz.all_timezones:
325+
zts = utc.tz_convert(pytz.timezone(z))
326+
self.assert_(utc == zts)
327+
328+
rng = date_range('3/1/2001', '4/1/2001', freq='H', tz='utc')
329+
for z in pytz.all_timezones:
330+
rng_z = rng.tz_convert(z)
331+
for k1, k2 in zip(rng, rng_z):
332+
self.assert_(k1 == k2)
320333

321334
if __name__ == '__main__':
322335
nose.runmodule(argv=[__file__,'-vvs','-x','--pdb', '--pdb-failure'],

0 commit comments

Comments
 (0)