示例#1
0
def test_exclude_path_with_old_setting():
    # TODO(#63): remove deprecated `skip_validation` setting in v2.0.
    paths = [r'/foo/', r'/bar/']
    assert_eq_regex_lists(
        get_exclude_paths(
            Mock(settings={'pyramid_swagger.skip_validation': paths})),
        [re.compile(r) for r in paths])
示例#2
0
def test_exclude_path_with_string():
    path_string = r'/foo/'
    registry = Mock(settings={'pyramid_swagger.exclude_paths': path_string})
    assert_eq_regex_lists(
        get_exclude_paths(registry),
        [re.compile(r) for r in [path_string]]
    )
示例#3
0
def test_exclude_path_with_old_setting():
    # TODO(#63): remove deprecated `skip_validation` setting in v2.0.
    paths = [r'/foo/', r'/bar/']
    assert_eq_regex_lists(
        get_exclude_paths(
            Mock(settings={'pyramid_swagger.skip_validation': paths})),
        [re.compile(r) for r in paths]
    )
示例#4
0
def test_exclude_path_with_overrides():
    paths = [r'/foo/', r'/bar/']
    compiled = get_exclude_paths(
        Mock(settings={'pyramid_swagger.exclude_paths': paths}))
    assert_eq_regex_lists(
        compiled,
        [re.compile(r) for r in paths]
    )
示例#5
0
def test_default_exclude_paths():
    assert_eq_regex_lists(get_exclude_paths(Mock(settings={})),
                          [re.compile(r) for r in DEFAULT_EXCLUDED_PATHS])
示例#6
0
def test_exclude_path_with_overrides():
    paths = [r'/foo/', r'/bar/']
    assert get_exclude_paths(
        Mock(settings={'pyramid_swagger.exclude_paths': paths})) \
        == [re.compile(r) for r in paths]
示例#7
0
def test_default_exclude_paths():
    assert_eq_regex_lists(
        get_exclude_paths(Mock(settings={})),
        [re.compile(r) for r in DEFAULT_EXCLUDED_PATHS]
    )
示例#8
0
def test_exclude_path_with_string():
    path_string = r'/foo/'
    assert get_exclude_paths(
        Mock(settings={'pyramid_swagger.exclude_paths': path_string})) \
        == [re.compile(r) for r in [path_string]]
示例#9
0
def test_default_exclude_paths():
    assert get_exclude_paths(Mock(settings={})) \
        == [re.compile(r) for r in DEFAULT_EXCLUDED_PATHS]
示例#10
0
def test_exclude_path_with_overrides():
    paths = [r'/foo/', r'/bar/']
    assert get_exclude_paths(
        Mock(settings={'pyramid_swagger.exclude_paths': paths})) \
        == [re.compile(r) for r in paths]
示例#11
0
def test_exclude_path_with_string():
    path_string = r'/foo/'
    assert get_exclude_paths(
        Mock(settings={'pyramid_swagger.exclude_paths': path_string})) \
        == [re.compile(r) for r in [path_string]]
示例#12
0
def test_default_exclude_paths():
    assert get_exclude_paths(Mock(settings={})) \
        == [re.compile(r) for r in DEFAULT_EXCLUDED_PATHS]