Fix config things relying on dict order
This commit is contained in:
parent
8933b4c5da
commit
0528a800f2
@ -480,7 +480,7 @@ class Config(QObject):
|
||||
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 @@ class TestConfig:
|
||||
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 @@ class TestParseYamlBackend:
|
||||
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]),
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user