configdata: Make sure default values are valid

This commit is contained in:
Florian Bruhin 2017-06-15 14:53:44 +02:00
parent 0857a45b0a
commit 18eb133811
2 changed files with 4 additions and 3 deletions

View File

@ -76,7 +76,7 @@ editor.command:
type:
name: ShellCommand
placeholder: true
default: "gvim -f '{}'"
default: ["gvim", "-f", "{}"]
desc: >-
The editor (and arguments) to use for the `open-editor` command.

View File

@ -28,10 +28,12 @@ from qutebrowser.utils import usertypes
def test_init():
"""Test reading the default yaml file."""
"""Test reading the default yaml file and validating the values."""
configdata.init()
assert isinstance(configdata.DATA, dict)
assert 'ignore_case' in configdata.DATA
for option in configdata.DATA.values():
option.typ.from_py(option.default)
def test_init_benchmark(benchmark):
@ -40,7 +42,6 @@ def test_init_benchmark(benchmark):
class TestReadYaml:
def test_valid(self):
data = textwrap.dedent("""
test1: