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

Function test_is_birthday

tests/date/test_comparison.py:158–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156
157
158def test_is_birthday(): # backward compatibility
159 d = pendulum.Date.today()
160 an_anniversary = d.subtract(years=1)
161 assert an_anniversary.is_birthday()
162 not_an_anniversary = d.subtract(days=1)
163 assert not not_an_anniversary.is_birthday()
164 also_not_an_anniversary = d.add(days=2)
165 assert not also_not_an_anniversary.is_birthday()
166
167 d1 = pendulum.Date(1987, 4, 23)
168 d2 = pendulum.Date(2014, 9, 26)
169 d3 = pendulum.Date(2014, 4, 23)
170 assert not d2.is_birthday(d1)
171 assert d3.is_birthday(d1)
172
173
174def test_closest():

Callers

nothing calls this directly

Calls 3

todayMethod · 0.45
subtractMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…