示例#1
0
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
示例#2
0
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
示例#3
0
def test_parse_durations_with_days(string, expected):
    expect(parse_delta(string)) == expected
示例#4
0
def test_parse_partially_defined_durations(string, expected):
    expect(parse_delta(string)) == expected
示例#5
0
def test_parse_null_duration():
    expect(parse_delta('')) == timedelta()
示例#6
0
def test_parse_duration(string, expected):
    expect(parse_delta(string)) == expected
示例#7
0
def test_parse_durations_with_days(string, expected):
    expect(parse_delta(string)) == expected
示例#8
0
def test_parse_partially_defined_durations(string, expected):
    expect(parse_delta(string)) == expected
示例#9
0
def test_parse_null_duration():
    expect(parse_delta('')) == timedelta()
示例#10
0
def test_parse_duration(string, expected):
    expect(parse_delta(string)) == expected