Merge branch 'master' of https://github.com/haxwithaxe/qutebrowser into haxwithaxe-master
This commit is contained in:
commit
a932183909
@ -1196,7 +1196,7 @@ class SearchEngineUrl(BaseType):
|
|||||||
self._basic_validation(value)
|
self._basic_validation(value)
|
||||||
if not value:
|
if not value:
|
||||||
return
|
return
|
||||||
elif '{}' not in value:
|
elif not ('{}' in value or '{0}' in value):
|
||||||
raise configexc.ValidationError(value, "must contain \"{}\"")
|
raise configexc.ValidationError(value, "must contain \"{}\"")
|
||||||
try:
|
try:
|
||||||
value.format("")
|
value.format("")
|
||||||
|
@ -1726,6 +1726,8 @@ class TestSearchEngineUrl:
|
|||||||
|
|
||||||
@pytest.mark.parametrize('val', [
|
@pytest.mark.parametrize('val', [
|
||||||
'http://example.com/?q={}',
|
'http://example.com/?q={}',
|
||||||
|
'http://example.com/?q={0}',
|
||||||
|
'http://example.com/?q={0}&a={0}',
|
||||||
'', # empty value with none_ok
|
'', # empty value with none_ok
|
||||||
])
|
])
|
||||||
def test_validate_valid(self, klass, val):
|
def test_validate_valid(self, klass, val):
|
||||||
|
Loading…
Reference in New Issue
Block a user