configdata: Make sure default values are valid
This commit is contained in:
parent
0857a45b0a
commit
18eb133811
@ -76,7 +76,7 @@ editor.command:
|
|||||||
type:
|
type:
|
||||||
name: ShellCommand
|
name: ShellCommand
|
||||||
placeholder: true
|
placeholder: true
|
||||||
default: "gvim -f '{}'"
|
default: ["gvim", "-f", "{}"]
|
||||||
desc: >-
|
desc: >-
|
||||||
The editor (and arguments) to use for the `open-editor` command.
|
The editor (and arguments) to use for the `open-editor` command.
|
||||||
|
|
||||||
|
@ -28,10 +28,12 @@ from qutebrowser.utils import usertypes
|
|||||||
|
|
||||||
|
|
||||||
def test_init():
|
def test_init():
|
||||||
"""Test reading the default yaml file."""
|
"""Test reading the default yaml file and validating the values."""
|
||||||
configdata.init()
|
configdata.init()
|
||||||
assert isinstance(configdata.DATA, dict)
|
assert isinstance(configdata.DATA, dict)
|
||||||
assert 'ignore_case' in configdata.DATA
|
assert 'ignore_case' in configdata.DATA
|
||||||
|
for option in configdata.DATA.values():
|
||||||
|
option.typ.from_py(option.default)
|
||||||
|
|
||||||
|
|
||||||
def test_init_benchmark(benchmark):
|
def test_init_benchmark(benchmark):
|
||||||
@ -40,7 +42,6 @@ def test_init_benchmark(benchmark):
|
|||||||
|
|
||||||
class TestReadYaml:
|
class TestReadYaml:
|
||||||
|
|
||||||
|
|
||||||
def test_valid(self):
|
def test_valid(self):
|
||||||
data = textwrap.dedent("""
|
data = textwrap.dedent("""
|
||||||
test1:
|
test1:
|
||||||
|
Loading…
Reference in New Issue
Block a user