コード例 #1
0
ファイル: test_config.py プロジェクト: ppires/LinOTP
def schema():
    return [
        s.ConfigItem("FOO", str, default="bar", help="help for FOO"),
        s.ConfigItem("BAZ", int, default=123, help="help for BAZ"),
        s.ConfigItem("POS",
                     int,
                     validate=s.check_int_in_range(0, None),
                     default=123,
                     help="help for POS"),
        s.ConfigItem("CVT",
                     int,
                     convert=lambda s: int(s) + 1,
                     default=0,
                     help="help for CVT")
    ]
コード例 #2
0
ファイル: test_config.py プロジェクト: ppires/LinOTP
def test_check_int_in_range_doc(min, max, doc):
    validate = s.check_int_in_range(min, max)
    assert validate.__doc__ == doc
コード例 #3
0
ファイル: test_config.py プロジェクト: ppires/LinOTP
def test_check_int_in_range_result(min, max, value, result, msg):
    validate_result_tester(s.check_int_in_range(min, max), value, result, msg)