コード例 #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
ファイル: test_time_util.py プロジェクト: Omosofe/pyoidc
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
ファイル: test_time_util.py プロジェクト: zizhang-wish/pyoidc
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
ファイル: test_time_util.py プロジェクト: htobenothing/pyoidc
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
ファイル: test_time_util.py プロジェクト: Omosofe/pyoidc
def test_parse_duration_error(duration):
    with pytest.raises(TimeUtilError):
        parse_duration(duration)