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

Function test_farthest_with_datetime

tests/datetime/test_comparison.py:346–359  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344
345
346def test_farthest_with_datetime():
347 instance = pendulum.datetime(2015, 5, 28, 12, 0, 0)
348 dt1 = datetime(2015, 5, 28, 11, 0, 0, tzinfo=pendulum.UTC)
349 dt2 = datetime(2015, 5, 28, 14, 0, 0, tzinfo=pendulum.UTC)
350 farthest = instance.farthest(dt1, dt2)
351 assert_datetime(farthest, 2015, 5, 28, 14, 0, 0)
352
353 dts = [
354 pendulum.datetime(2015, 5, 28, 16, 0, 0) + pendulum.duration(hours=x)
355 for x in range(4)
356 ]
357 farthest = instance.farthest(dt1, dt2, *dts)
358
359 assert_datetime(farthest, 2015, 5, 28, 19, 0, 0)
360
361
362def test_farthest_with_equals():

Callers

nothing calls this directly

Calls 4

assert_datetimeFunction · 0.90
datetimeFunction · 0.85
datetimeMethod · 0.45
farthestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…