示例#1
0
def test_process_variable_url_raises_exception_when_not_providing_all_variables():
    with pytest.raises(URLParseException) as exceptionInfo:
        url.process_variable_url('/<href>/<foo>', {'href': 'given'}, None)

    # Assert exception message
    assert str(exceptionInfo.value) == "Missing URL replacements: ['foo']"
示例#2
0
def test_process_variable_url(url_pattern, expected, variable_replacements, custom_url):
    assert expected == url.process_variable_url(url_pattern, variable_replacements, custom_url)
示例#3
0
def test_process_variable_url_raises_exception_when_using_wildcards_and_variables():
    with pytest.raises(URLParseException) as exceptionInfo:
        url.process_variable_url('/<href>/*', None, None)

    # Assert exception message
    assert str(exceptionInfo.value) == "You can't combine wildcards and variables in a URL"