Пример #1
0
def test_period_is_overlapping():
    start = datetime.fromisoformat('2020-10-01T12:00:00')
    end = datetime.fromisoformat('2020-10-01T13:00:00')
    period1 = Period(start, end)
    period2 = Period(start, end)

    is_overlapping = period1.is_overlapped(period2)

    assert is_overlapping == True
Пример #2
0
def test_period_is_overlapping_5():
    start1 = datetime.fromisoformat('2020-10-01T12:00:00')
    end1 = datetime.fromisoformat('2020-10-01T15:00:00')
    period1 = Period(start1, end1)

    start2 = datetime.fromisoformat('2020-10-01T15:00:00')
    end2 = datetime.fromisoformat('2020-10-01T18:00:00')
    period2 = Period(start2, end2)

    is_overlapping = period1.is_overlapped(period2)

    assert is_overlapping == True