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

Function test_day_of_year

tests/formatting/test_formatter.py:78–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76
77
78def test_day_of_year():
79 f = Formatter()
80 d = pendulum.datetime(2016, 8, 28)
81 assert f.format(d, "DDDD") == "241"
82 assert f.format(d, "DDD") == "241"
83 assert f.format(d.start_of("year"), "DDDD") == "001"
84 assert f.format(d.start_of("year"), "DDD") == "1"
85
86 assert f.format(d, "DDDo") == "241st"
87 assert f.format(d.add(days=3), "DDDo") == "244th"
88
89 assert f.format(d, "DDDo", locale="fr") == "241e"
90 assert f.format(d.add(days=3), "DDDo", locale="fr") == "244e"
91
92
93def test_week_of_year():

Callers

nothing calls this directly

Calls 5

formatMethod · 0.95
FormatterClass · 0.90
datetimeMethod · 0.45
start_ofMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…