def test_event_creation(task, start, delta, message): e = Event(task, start, delta, message) expect(e.task) == task if isinstance(start, datetime): expect(e.start) == start elif start: expect(e.start) == parse_datetime(start) else: # Special case to ignore comparison against utcnow() pass if isinstance(delta, timedelta): expect(e.delta) == delta else: expect(e.delta) == parse_delta(delta) expect(e.message) == message
def test_parse_durations_with_days(string, expected): expect(parse_delta(string)) == expected
def test_parse_partially_defined_durations(string, expected): expect(parse_delta(string)) == expected
def test_parse_null_duration(): expect(parse_delta('')) == timedelta()
def test_parse_duration(string, expected): expect(parse_delta(string)) == expected