MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / test_on_last_transition

Function test_on_last_transition

tests/tz/test_timezone.py:288–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286 )
287)
288def test_on_last_transition():
289 tz = pendulum.timezone("Europe/Paris")
290 dt = pendulum.naive(2037, 10, 25, 2, 30)
291 dt = tz.convert(dt, dst_rule=pendulum.POST_TRANSITION)
292
293 assert dt.year == 2037
294 assert dt.month == 10
295 assert dt.day == 25
296 assert dt.hour == 2
297 assert dt.minute == 30
298 assert dt.second == 0
299 assert dt.microsecond == 0
300 assert dt.utcoffset().total_seconds() == 3600
301
302 dt = pendulum.naive(2037, 10, 25, 2, 30)
303 dt = tz.convert(dt, dst_rule=pendulum.PRE_TRANSITION)
304
305 assert dt.year == 2037
306 assert dt.month == 10
307 assert dt.day == 25
308 assert dt.hour == 2
309 assert dt.minute == 30
310 assert dt.second == 0
311 assert dt.microsecond == 0
312 assert dt.utcoffset().total_seconds() == 7200
313
314
315def test_convert_fold_attribute_is_honored():

Callers

nothing calls this directly

Calls 5

timezoneMethod · 0.80
naiveMethod · 0.80
utcoffsetMethod · 0.80
convertMethod · 0.45
total_secondsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…