Пример #1
0
def test_parse_duration():
    (sign, d) = parse_duration("P1Y3M5DT7H10M3.3S")
    assert sign == "+"
    assert d['tm_sec'] == 3.3
    assert d['tm_mon'] == 3
    assert d['tm_hour'] == 7
    assert d['tm_mday'] == 5
    assert d['tm_year'] == 1
    assert d['tm_min'] == 10
Пример #2
0
def test_parse_duration():
    (sign, d) = parse_duration("P1Y3M5DT7H10M3.3S")
    assert sign == "+"
    assert d['tm_sec'] == 3.3
    assert d['tm_mon'] == 3
    assert d['tm_hour'] == 7
    assert d['tm_mday'] == 5
    assert d['tm_year'] == 1
    assert d['tm_min'] == 10
Пример #3
0
def test_parse_duration():
    (sign, d) = parse_duration("P1Y3M5DT7H10M3.3S")
    assert sign == "+"
    assert d["tm_sec"] == 3.3
    assert d["tm_mon"] == 3
    assert d["tm_hour"] == 7
    assert d["tm_mday"] == 5
    assert d["tm_year"] == 1
    assert d["tm_min"] == 10
Пример #4
0
def test_parse_duration():
    (sign, d) = parse_duration("P1Y3M5DT7H10M3.3S")
    assert sign == "+"
    assert d["tm_sec"] == 3.3
    assert d["tm_mon"] == 3
    assert d["tm_hour"] == 7
    assert d["tm_mday"] == 5
    assert d["tm_year"] == 1
    assert d["tm_min"] == 10
Пример #5
0
def test_parse_duration_error(duration):
    with pytest.raises(TimeUtilError):
        parse_duration(duration)
Пример #6
0
def test_parse_duration_error(duration):
    with pytest.raises(TimeUtilError):
        parse_duration(duration)