Example #1
0
def test_add_duration_2():
    # 2000-01-12 PT33H   2000-01-13
    t = add_duration(str_to_time("2000-01-12T00:00:00Z"), "PT33H")
    assert t.tm_year == 2000
    assert t.tm_mon == 1
    assert t.tm_mday == 14
    assert t.tm_hour == 9
    assert t.tm_min == 0
    assert t.tm_sec == 0
Example #2
0
def test_add_duration_2():
    # 2000-01-12 PT33H   2000-01-13
    t = add_duration(str_to_time("2000-01-12T00:00:00Z"), "PT33H")
    assert t.tm_year == 2000
    assert t.tm_mon == 1
    assert t.tm_mday == 14
    assert t.tm_hour == 9
    assert t.tm_min == 0
    assert t.tm_sec == 0
Example #3
0
def test_add_duration_1():
    # 2000-01-12T12:13:14Z	P1Y3M5DT7H10M3S	2001-04-17T19:23:17Z
    t = add_duration(str_to_time("2000-01-12T12:13:14Z"), "P1Y3M5DT7H10M3S")
    assert t.tm_year == 2001
    assert t.tm_mon == 4
    assert t.tm_mday == 17
    assert t.tm_hour == 19
    assert t.tm_min == 23
    assert t.tm_sec == 17
Example #4
0
def test_add_duration_1():
    # 2000-01-12T12:13:14Z	P1Y3M5DT7H10M3S	2001-04-17T19:23:17Z
    t = add_duration(str_to_time("2000-01-12T12:13:14Z"), "P1Y3M5DT7H10M3S")
    assert t.tm_year == 2001
    assert t.tm_mon == 4
    assert t.tm_mday == 17
    assert t.tm_hour == 19
    assert t.tm_min == 23
    assert t.tm_sec == 17
Example #5
0
def test_add_duration_3():
    # 2000-01-12 PT33H   2000-01-13
    t = add_duration(str_to_time("2000-01-12T00:00:00Z"), "P32D")
    assert t.tm_year == 2000
    assert t.tm_mon == 2
    assert t.tm_mday == 12
    assert t.tm_hour == 0
    assert t.tm_min == 0
    assert t.tm_sec == 0
    assert t.tm_wday == 5
    assert t.tm_wday == 5
    assert t.tm_yday == 43
    assert t.tm_isdst == 0
Example #6
0
def test_add_duration_3():
    # 2000-01-12 PT33H   2000-01-13
    t = add_duration(str_to_time("2000-01-12T00:00:00Z"), "P32D")
    assert t.tm_year == 2000
    assert t.tm_mon == 2
    assert t.tm_mday == 12
    assert t.tm_hour == 0
    assert t.tm_min == 0
    assert t.tm_sec == 0
    assert t.tm_wday == 5
    assert t.tm_wday == 5
    assert t.tm_yday == 43
    assert t.tm_isdst == 0
Example #7
0
def test_add_duration_4():
    # 2000-01-12 PT33H   2000-01-13
    t = add_duration(str_to_time("2000-01-12T00:00:00Z"), "-P32D")
    assert t is None
Example #8
0
def test_add_duration_4():
    # 2000-01-12 PT33H   2000-01-13
    t = add_duration(str_to_time("2000-01-12T00:00:00Z"), "-P32D")
    assert t is None