Пример #1
0
def test_date_ranges_arent_near(start, end, other_start, other_end):
    date = d(2000, 1, 5)
    obj = DateRange(dt.combine(date, start), dt.combine(date, end))
    other = DateRange(dt.combine(date, other_start), dt.combine(date, other_end))

    obj.near_time = td(seconds=300)
    assert not obj.near(other)
Пример #2
0
def test_date_ranges_contains_date(start, end, other):
    obj = DateRange(start, end)

    assert other in obj
    assert obj.near(other)
Пример #3
0
def test_date_ranges_near_date(start, end, other):
    date = d(2000, 1, 5)
    obj = DateRange(dt.combine(date, start), dt.combine(date, end))

    obj.near_time = td(seconds=300)
    assert obj.near(dt.combine(date, other))