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

Function test_divide

tests/duration/test_arithmetic.py:30–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29
30def test_divide():
31 it = pendulum.duration(days=2, seconds=34, microseconds=522222)
32 mul = it / 2
33
34 assert isinstance(mul, pendulum.Duration)
35 assert_duration(mul, 0, 0, 0, 1, 0, 0, 17, 261111)
36
37 it = pendulum.duration(days=2, seconds=35, microseconds=522222)
38 mul = it / 2
39
40 assert isinstance(mul, pendulum.Duration)
41 assert_duration(mul, 0, 0, 0, 1, 0, 0, 17, 761111)
42
43 it = pendulum.duration(days=2, seconds=35, microseconds=522222)
44 mul = it / 1.1
45
46 assert isinstance(mul, pendulum.Duration)
47 assert_duration(mul, 0, 0, 0, 1, 19, 38, 43, 202020)
48
49 it = pendulum.duration(years=2, months=4, days=2, seconds=35, microseconds=522222)
50 mul = it / 2
51
52 assert isinstance(mul, pendulum.Duration)
53 assert_duration(mul, 1, 2, 0, 1, 0, 0, 17, 761111)
54
55 it = pendulum.duration(years=2, months=4, days=2, seconds=35, microseconds=522222)
56 mul = it / 2.0
57
58 assert isinstance(mul, pendulum.Duration)
59 assert_duration(mul, 1, 2, 0, 1, 0, 0, 17, 761111)
60
61
62def test_floor_divide():

Callers

nothing calls this directly

Calls 1

assert_durationFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…