def test_sum_durations(): now = datetime.now(timezone.utc) events = [] for i in range(10): events.append(Event(timestamp=now + timedelta(seconds=i), duration=timedelta(seconds=1))) result = sum_durations(events) assert result == timedelta(seconds=10)
def q2_sum_durations(events: list) -> timedelta: return sum_durations(events)
def q2_sum_durations(events: list) -> timedelta: _verify_variable_is_type(events, list) return sum_durations(events)