Did I find the right examples for you? yes no

All Samples(21)  |  Call(19)  |  Derive(0)  |  Import(2)

        def valid_duration(val):
    try:
        time_util.parse_duration(val)
    except Exception:
        raise NotValid("duration")
    return True
        


src/p/y/pysaml2-HEAD/tests/test_13_validate.py   pysaml2(Download)
from saml2 import samlp
from saml2 import md
from saml2.validate import valid_duration, MustValueError
from saml2.validate import valid_unsigned_short
from saml2.validate import valid_non_negative_integer
def test_duration():
    assert valid_duration("P1Y2M3DT10H30M")
    assert valid_duration("P1Y2M3DT10H30M1.567S")
    assert valid_duration("-P120D")
    assert valid_duration("P1347Y")

src/p/y/pysaml2-2.0.0/tests/test_13_validate.py   pysaml2(Download)
from saml2 import samlp
from saml2 import md
from saml2.validate import valid_duration, MustValueError
from saml2.validate import valid_unsigned_short
from saml2.validate import valid_non_negative_integer
def test_duration():
    assert valid_duration("P1Y2M3DT10H30M")
    assert valid_duration("P1Y2M3DT10H30M1.567S")
    assert valid_duration("-P120D")
    assert valid_duration("P1347Y")