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

Function test_is_anniversary

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

Source from the content-addressed store, hash-verified

140
141
142def test_is_anniversary():
143 d = pendulum.Date.today()
144 an_anniversary = d.subtract(years=1)
145 assert an_anniversary.is_anniversary()
146 not_an_anniversary = d.subtract(days=1)
147 assert not not_an_anniversary.is_anniversary()
148 also_not_an_anniversary = d.add(days=2)
149 assert not also_not_an_anniversary.is_anniversary()
150
151 d1 = pendulum.Date(1987, 4, 23)
152 d2 = pendulum.Date(2014, 9, 26)
153 d3 = pendulum.Date(2014, 4, 23)
154 assert not d2.is_anniversary(d1)
155 assert d3.is_anniversary(d1)
156
157
158def test_is_birthday(): # backward compatibility

Callers

nothing calls this directly

Calls 4

is_anniversaryMethod · 0.95
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…