Skip to content

Commit c836cb3

Browse files
committed
Add tests
1 parent 891ac09 commit c836cb3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Lib/test/datetimetester.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,6 +3122,18 @@ def dst(self, dt): return 1
31223122
with self.assertRaises(TypeError):
31233123
dt_broken.astimezone()
31243124

3125+
dt_big = self.theclass(9999, 12, 31, 23, 59, 59)
3126+
dt_big_utc = dt_big.replace(hour=19,
3127+
tzinfo=timezone(timedelta(hours=-4), 'EDT'))
3128+
self.assertEqual(dt_big_utc,
3129+
dt_big.replace(tzinfo=timezone.utc).astimezone())
3130+
3131+
other_tz = timezone(timedelta(hours=+4), '+04')
3132+
dt_other_tz = dt_big.replace(tzinfo=other_tz)
3133+
dt_utc_tz = dt_big.replace(tzinfo=timezone.utc)
3134+
self.assertEqual(dt_other_tz, dt_other_tz.astimezone(tz=other_tz))
3135+
self.assertEqual(dt_utc_tz, dt_utc_tz.astimezone(tz=timezone.utc))
3136+
31253137
def test_subclass_datetime(self):
31263138

31273139
class C(self.theclass):

0 commit comments

Comments
 (0)