| 320 | |
| 321 | |
| 322 | def test_farthest(): |
| 323 | instance = pendulum.datetime(2015, 5, 28, 12, 0, 0) |
| 324 | dt1 = pendulum.datetime(2015, 5, 28, 11, 0, 0) |
| 325 | dt2 = pendulum.datetime(2015, 5, 28, 14, 0, 0) |
| 326 | farthest = instance.farthest(dt1, dt2) |
| 327 | assert farthest == dt2 |
| 328 | |
| 329 | farthest = instance.farthest(dt2, dt1) |
| 330 | assert farthest == dt2 |
| 331 | |
| 332 | dts = [ |
| 333 | pendulum.datetime(2015, 5, 28, 16, 0, 0) + pendulum.duration(hours=x) |
| 334 | for x in range(4) |
| 335 | ] |
| 336 | farthest = instance.farthest(*dts) |
| 337 | assert farthest == dts[-1] |
| 338 | |
| 339 | farthest = instance.farthest(*(dts[::-1])) |
| 340 | assert farthest == dts[-1] |
| 341 | |
| 342 | f = pendulum.datetime(2010, 1, 1, 0, 0, 0) |
| 343 | assert f == instance.farthest(f, *(dts)) |
| 344 | |
| 345 | |
| 346 | def test_farthest_with_datetime(): |