|
@@ -99,7 +99,7 @@ def test_settings_fields_sane():
|
|
|
paths = [p for _g, p, _l, _t, _d in ui.SETTINGS_FIELDS]
|
|
paths = [p for _g, p, _l, _t, _d in ui.SETTINGS_FIELDS]
|
|
|
assert len(paths) == len(set(paths)) # 键路径唯一
|
|
assert len(paths) == len(set(paths)) # 键路径唯一
|
|
|
types = {_t for _g, _p, _l, _t, _d in ui.SETTINGS_FIELDS}
|
|
types = {_t for _g, _p, _l, _t, _d in ui.SETTINGS_FIELDS}
|
|
|
- assert types <= {'int', 'float', 'str', 'bool', 'list'}
|
|
|
|
|
|
|
+ assert types <= {'int', 'float', 'str', 'bool', 'list', 'irange'}
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_form_roundtrip():
|
|
def test_form_roundtrip():
|
|
@@ -108,7 +108,7 @@ def test_form_roundtrip():
|
|
|
expect = {}
|
|
expect = {}
|
|
|
for _g, path, _l, typ, default in ui.SETTINGS_FIELDS:
|
|
for _g, path, _l, typ, default in ui.SETTINGS_FIELDS:
|
|
|
expect[path] = {'int': 7, 'float': 1.5, 'str': 'x', 'bool': True,
|
|
expect[path] = {'int': 7, 'float': 1.5, 'str': 'x', 'bool': True,
|
|
|
- 'list': ['a', 'b']}[typ]
|
|
|
|
|
|
|
+ 'list': ['a', 'b'], 'irange': [30, 180]}[typ]
|
|
|
ui._bury(cfg, path, expect[path])
|
|
ui._bury(cfg, path, expect[path])
|
|
|
vals = ui.form_values(cfg)
|
|
vals = ui.form_values(cfg)
|
|
|
out = {}
|
|
out = {}
|