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

Function test_floor_divide

tests/interval/test_arithmetic.py:40–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39
40def test_floor_divide():
41 dt1 = pendulum.DateTime(2016, 8, 7, 12, 34, 56)
42 dt2 = dt1.add(days=2, seconds=34)
43 it = pendulum.interval(dt1, dt2)
44 mul = it // 2
45 assert isinstance(mul, pendulum.Duration)
46 assert_duration(mul, 0, 0, 0, 1, 0, 0, 17)
47
48 dt1 = pendulum.DateTime(2016, 8, 7, 12, 34, 56)
49 dt2 = dt1.add(days=2, seconds=35)
50 it = pendulum.interval(dt1, dt2)
51 mul = it // 3
52 assert isinstance(mul, pendulum.Duration)
53 assert_duration(mul, 0, 0, 0, 0, 16, 0, 11)

Callers

nothing calls this directly

Calls 2

addMethod · 0.95
assert_durationFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…