()
| 122 | |
| 123 | |
| 124 | def test_closest(): |
| 125 | instance = pendulum.time(12, 34, 56) |
| 126 | t1 = pendulum.time(12, 34, 54) |
| 127 | t2 = pendulum.time(12, 34, 59) |
| 128 | closest = instance.closest(t1, t2) |
| 129 | assert t1 == closest |
| 130 | |
| 131 | closest = instance.closest(t2, t1) |
| 132 | assert t1 == closest |
| 133 | |
| 134 | |
| 135 | def test_closest_with_time(): |