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

Function test_divide

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

Source from the content-addressed store, hash-verified

22
23
24def test_divide():
25 dt1 = pendulum.DateTime(2016, 8, 7, 12, 34, 56)
26 dt2 = dt1.add(days=2, seconds=34)
27 it = pendulum.interval(dt1, dt2)
28 mul = it / 2
29 assert isinstance(mul, pendulum.Duration)
30 assert_duration(mul, 0, 0, 0, 1, 0, 0, 17)
31
32 dt1 = pendulum.DateTime(2016, 8, 7, 12, 34, 56)
33 dt2 = dt1.add(days=2, seconds=35)
34 it = pendulum.interval(dt1, dt2)
35 mul = it / 2
36 assert isinstance(mul, pendulum.Duration)
37 assert_duration(mul, 0, 0, 0, 1, 0, 0, 17)
38
39
40def test_floor_divide():

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…