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

Function test_replace_tzinfo_dst_off

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

Source from the content-addressed store, hash-verified

6
7
8def test_replace_tzinfo_dst_off():
9 utc = pendulum.datetime(2016, 3, 27, 0, 30) # 30 min before DST turning on
10 in_paris = utc.in_tz("Europe/Paris")
11
12 assert_datetime(in_paris, 2016, 3, 27, 1, 30, 0)
13
14 in_paris = in_paris.replace(second=1)
15
16 assert_datetime(in_paris, 2016, 3, 27, 1, 30, 1)
17 assert not in_paris.is_dst()
18 assert in_paris.offset == 3600
19 assert in_paris.timezone_name == "Europe/Paris"
20
21
22def test_replace_tzinfo_dst_transitioning_on():

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…