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

Function test_replace_tzinfo_dst_on

tests/datetime/test_replace.py:36–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def test_replace_tzinfo_dst_on():
37 utc = pendulum.datetime(2016, 10, 30, 0, 30) # 30 min before DST turning off
38 in_paris = utc.in_tz("Europe/Paris")
39
40 assert_datetime(in_paris, 2016, 10, 30, 2, 30, 0)
41
42 in_paris = in_paris.replace(second=1)
43
44 assert_datetime(in_paris, 2016, 10, 30, 2, 30, 1)
45 assert in_paris.is_dst()
46 assert in_paris.offset == 7200
47 assert in_paris.timezone_name == "Europe/Paris"
48
49
50def test_replace_tzinfo_dst_transitioning_off():

Callers

nothing calls this directly

Calls 5

assert_datetimeFunction · 0.90
in_tzMethod · 0.80
is_dstMethod · 0.80
datetimeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…