Permalink
Browse files

Fix config things relying on dict order

  • Loading branch information...
The-Compiler committed Jul 4, 2017
1 parent 8933b4c commit 0528a800f264a52b7dfdbff21c5d2b64a9001ad2
@@ -480,7 +480,7 @@ def dump_userconfig(self):
The changed config part as string.
"""
lines = []
for optname, value in self._values.items():
for optname, value in sorted(self._values.items()):
opt = self.get_opt(optname)
str_value = opt.typ.to_str(value)
lines.append('{} = {}'.format(optname, str_value))
@@ -129,7 +129,7 @@ def _parse_yaml_backends_dict(name, node):
'Qt 5.8': qtutils.version_check('5.8'),
'Qt 5.9': qtutils.version_check('5.9'),
}
for key in node.keys():
for key in sorted(node.keys()):
if conditionals[node[key]]:
backends.append(str_to_backend[key])
@@ -743,8 +743,8 @@ def test_set_wrong_backend(self, conf, qtbot, monkeypatch, method):
def test_dump_userconfig(self, conf):
conf.set_obj('content.plugins', True)
conf.set_obj('content.headers.custom', {'X-Foo': 'bar'})
lines = ['content.plugins = true',
'content.headers.custom = {"X-Foo": "bar"}']
lines = ['content.headers.custom = {"X-Foo": "bar"}',
'content.plugins = true']
assert conf.dump_userconfig().splitlines() == lines
def test_dump_userconfig_default(self, conf):
@@ -219,8 +219,8 @@ def test_simple(self, backend, expected):
assert backends == expected
@pytest.mark.parametrize('webkit, has_new_version, expected', [
(True, True, [usertypes.Backend.QtWebKit,
usertypes.Backend.QtWebEngine]),
(True, True, [usertypes.Backend.QtWebEngine,
usertypes.Backend.QtWebKit]),
(False, True, [usertypes.Backend.QtWebEngine]),
(True, False, [usertypes.Backend.QtWebKit]),
])

0 comments on commit 0528a80

Please sign in to comment.