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
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
def test_parse_duration_error(duration): with pytest.raises(TimeUtilError): parse_duration(duration)