Lines 1169-1174
Link Here
|
1169 |
self.assertEqual('2011-10-30T02:45:42.123456+01:00', |
1169 |
self.assertEqual('2011-10-30T02:45:42.123456+01:00', |
1170 |
dt.astimezone(datefmt.localtz).isoformat()) |
1170 |
dt.astimezone(datefmt.localtz).isoformat()) |
1171 |
|
1171 |
|
|
|
1172 |
def test_astimezone_invalid_range_on_gmt01(self): |
1173 |
self._tzset('GMT-1') |
1174 |
|
1175 |
# 1899-12-30T23:59:58+00:00 is -0x83ac4e92 for time_t, out of range |
1176 |
# for 32-bit signed integer |
1177 |
dt = datetime.datetime(1899, 12, 30, 23, 59, 58, 123456, datefmt.utc) |
1178 |
self.assertEqual('1899-12-31T00:59:58.123456+01:00', |
1179 |
dt.astimezone(datefmt.localtz).isoformat()) |
1180 |
dt = datetime.datetime(1899, 12, 30, 23, 59, 58, 123456, |
1181 |
datefmt.localtz) |
1182 |
self.assertEqual('1899-12-30T22:59:58.123456+00:00', |
1183 |
dt.astimezone(datefmt.utc).isoformat()) |
1184 |
|
1185 |
# 2040-12-31T23:59:58+00:00 is 0x858c84ee for time_t, out of range for |
1186 |
# 32-bit signed integer |
1187 |
dt = datetime.datetime(2040, 12, 31, 23, 59, 58, 123456, datefmt.utc) |
1188 |
self.assertEqual('2041-01-01T00:59:58.123456+01:00', |
1189 |
dt.astimezone(datefmt.localtz).isoformat()) |
1190 |
dt = datetime.datetime(2040, 12, 31, 23, 59, 58, 123456, |
1191 |
datefmt.localtz) |
1192 |
self.assertEqual('2040-12-31T22:59:58.123456+00:00', |
1193 |
dt.astimezone(datefmt.utc).isoformat()) |
1194 |
|
1172 |
def test_arithmetic_localized_non_existent_time(self): |
1195 |
def test_arithmetic_localized_non_existent_time(self): |
1173 |
self._tzset('Europe/Paris') |
1196 |
self._tzset('Europe/Paris') |
1174 |
t = datetime.datetime(2012, 3, 25, 1, 15, 42, 123456) |
1197 |
t = datetime.datetime(2012, 3, 25, 1, 15, 42, 123456) |