2022-12-14 19:42:24 -08:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
import json
|
2023-02-19 18:07:14 -08:00
|
|
|
from collections import defaultdict
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
import settngs
|
2023-01-31 19:18:09 -08:00
|
|
|
from settngs import Group
|
2022-12-15 18:53:29 -08:00
|
|
|
from testing.settngs import example
|
2022-12-14 19:42:24 -08:00
|
|
|
from testing.settngs import failure
|
|
|
|
from testing.settngs import success
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def settngs_manager():
|
|
|
|
manager = settngs.Manager()
|
|
|
|
yield manager
|
|
|
|
|
|
|
|
|
|
|
|
def test_settngs_manager():
|
|
|
|
manager = settngs.Manager()
|
|
|
|
defaults = manager.defaults()
|
|
|
|
assert manager is not None and defaults is not None
|
|
|
|
|
|
|
|
|
2022-12-15 18:53:29 -08:00
|
|
|
def test_settngs_manager_config():
|
|
|
|
manager = settngs.Manager(
|
|
|
|
definitions=settngs.Config[settngs.Namespace](
|
|
|
|
settngs.Namespace(),
|
2023-01-31 19:18:09 -08:00
|
|
|
{'tst': Group(False, {'test': settngs.Setting('--test', default='hello', group='tst', exclusive=False)})},
|
2022-12-15 18:53:29 -08:00
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
defaults = manager.defaults()
|
|
|
|
assert manager is not None and defaults is not None
|
|
|
|
assert defaults.values['tst']['test'] == 'hello'
|
|
|
|
|
|
|
|
|
2022-12-14 19:42:24 -08:00
|
|
|
@pytest.mark.parametrize('arguments, expected', success)
|
|
|
|
def test_setting_success(arguments, expected):
|
|
|
|
assert vars(settngs.Setting(*arguments[0], **arguments[1])) == expected
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('arguments, exception', failure)
|
|
|
|
def test_setting_failure(arguments, exception):
|
|
|
|
with exception:
|
|
|
|
settngs.Setting(*arguments[0], **arguments[1])
|
|
|
|
|
|
|
|
|
|
|
|
def test_add_setting(settngs_manager):
|
|
|
|
assert settngs_manager.add_setting('--test') is None
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_defaults(settngs_manager):
|
|
|
|
settngs_manager.add_setting('--test', default='hello')
|
2022-12-15 18:53:29 -08:00
|
|
|
defaults, _ = settngs_manager.defaults()
|
2022-12-14 19:42:24 -08:00
|
|
|
assert defaults['']['test'] == 'hello'
|
|
|
|
|
|
|
|
|
2023-02-20 01:59:40 -08:00
|
|
|
def test_get_defaults_namespace(settngs_manager):
|
2022-12-14 19:42:24 -08:00
|
|
|
settngs_manager.add_setting('--test', default='hello')
|
2022-12-15 18:53:29 -08:00
|
|
|
defaults, _ = settngs_manager.get_namespace(settngs_manager.defaults())
|
|
|
|
assert defaults.test == 'hello'
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_namespace_with_namespace(settngs_manager):
|
|
|
|
settngs_manager.add_setting('--test', default='hello')
|
2023-02-20 01:59:40 -08:00
|
|
|
defaults, _ = settngs_manager.get_namespace(argparse.Namespace(test='success'))
|
|
|
|
assert defaults.test == 'success'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_get_defaults_group(settngs_manager):
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello'))
|
2022-12-15 18:53:29 -08:00
|
|
|
defaults, _ = settngs_manager.defaults()
|
2022-12-14 19:42:24 -08:00
|
|
|
assert defaults['tst']['test'] == 'hello'
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_namespace_group(settngs_manager):
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello'))
|
2022-12-15 18:53:29 -08:00
|
|
|
defaults, _ = settngs_manager.get_namespace(settngs_manager.defaults())
|
2022-12-14 19:42:24 -08:00
|
|
|
assert defaults.tst_test == 'hello'
|
|
|
|
|
|
|
|
|
|
|
|
def test_cmdline_only(settngs_manager):
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', file=False))
|
|
|
|
settngs_manager.add_group('tst2', lambda parser: parser.add_setting('--test2', default='hello', cmdline=False))
|
|
|
|
|
2022-12-15 18:53:29 -08:00
|
|
|
file_normalized, _ = settngs_manager.normalize_config(settngs_manager.defaults(), file=True)
|
|
|
|
cmdline_normalized, _ = settngs_manager.normalize_config(settngs_manager.defaults(), cmdline=True)
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
assert 'test' in cmdline_normalized['tst']
|
|
|
|
assert 'test2' not in cmdline_normalized['tst2']
|
|
|
|
|
|
|
|
assert 'test' not in file_normalized['tst']
|
|
|
|
assert 'test2' in file_normalized['tst2']
|
|
|
|
|
|
|
|
|
2023-02-20 01:59:40 -08:00
|
|
|
def test_cmdline_only_persistent_group(settngs_manager):
|
|
|
|
settngs_manager.add_persistent_group('tst', lambda parser: parser.add_setting('--test', default='hello', file=False))
|
|
|
|
settngs_manager.add_group('tst2', lambda parser: parser.add_setting('--test2', default='hello', cmdline=False))
|
|
|
|
|
|
|
|
file_normalized, _ = settngs_manager.normalize_config(settngs_manager.defaults(), file=True)
|
|
|
|
cmdline_normalized, _ = settngs_manager.normalize_config(settngs_manager.defaults(), cmdline=True)
|
|
|
|
|
|
|
|
assert 'test' in cmdline_normalized['tst']
|
|
|
|
assert 'test2' not in cmdline_normalized['tst2']
|
|
|
|
|
|
|
|
assert 'test' not in file_normalized['tst']
|
|
|
|
assert 'test2' in file_normalized['tst2']
|
|
|
|
|
|
|
|
|
2022-12-14 19:42:24 -08:00
|
|
|
def test_normalize(settngs_manager):
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello'))
|
2023-01-31 19:18:09 -08:00
|
|
|
settngs_manager.add_persistent_group('persistent', lambda parser: parser.add_setting('--world', default='world'))
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
defaults = settngs_manager.defaults()
|
2023-01-31 19:18:09 -08:00
|
|
|
defaults.values['test'] = 'fail' # Not defined in settngs_manager, should be removed
|
|
|
|
defaults.values['persistent']['hello'] = 'success' # Not defined in settngs_manager, should stay
|
2022-12-14 19:42:24 -08:00
|
|
|
|
2022-12-15 18:53:29 -08:00
|
|
|
defaults_namespace = settngs_manager.get_namespace(settngs_manager.defaults())
|
2023-01-31 19:18:09 -08:00
|
|
|
defaults_namespace.values.test = 'fail' # Not defined in settngs_manager, should be removed
|
|
|
|
defaults_namespace.values.persistent_hello = 'success' # Not defined in settngs_manager, should stay
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
normalized, _ = settngs_manager.normalize_config(defaults, file=True)
|
2022-12-15 18:53:29 -08:00
|
|
|
normalized_from_namespace = settngs_manager.normalize_config(defaults_namespace, file=True)
|
|
|
|
normalized_namespace, _ = settngs_manager.get_namespace(normalized_from_namespace)
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
assert 'test' not in normalized
|
|
|
|
assert 'tst' in normalized
|
|
|
|
assert 'test' in normalized['tst']
|
|
|
|
assert normalized['tst']['test'] == 'hello'
|
2023-01-31 19:18:09 -08:00
|
|
|
assert normalized['persistent']['hello'] == 'success'
|
2023-02-20 01:59:40 -08:00
|
|
|
assert normalized['persistent']['world'] == 'world'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
assert not hasattr(normalized_namespace, 'test')
|
|
|
|
assert hasattr(normalized_namespace, 'tst_test')
|
|
|
|
assert normalized_namespace.tst_test == 'hello'
|
2023-01-31 19:18:09 -08:00
|
|
|
assert normalized_namespace.persistent_hello == 'success'
|
2023-02-20 01:59:40 -08:00
|
|
|
assert normalized_namespace.persistent_world == 'world'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_clean_config(settngs_manager):
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=False))
|
|
|
|
settngs_manager.add_group('tst2', lambda parser: parser.add_setting('--test2', default='hello', file=False))
|
2023-01-31 19:18:09 -08:00
|
|
|
settngs_manager.add_persistent_group('persistent', lambda parser: parser.add_setting('--world', default='world'))
|
2022-12-15 18:53:29 -08:00
|
|
|
normalized, _ = settngs_manager.defaults()
|
2022-12-14 19:42:24 -08:00
|
|
|
normalized['tst']['test'] = 'success'
|
2023-01-31 19:18:09 -08:00
|
|
|
normalized['persistent']['hello'] = 'success'
|
2022-12-14 19:42:24 -08:00
|
|
|
normalized['fail'] = 'fail'
|
|
|
|
|
|
|
|
cleaned = settngs_manager.clean_config(normalized, file=True)
|
|
|
|
|
|
|
|
assert 'fail' not in cleaned
|
|
|
|
assert 'tst2' not in cleaned
|
|
|
|
assert cleaned['tst']['test'] == 'success'
|
2023-01-31 19:18:09 -08:00
|
|
|
assert cleaned['persistent']['hello'] == 'success'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
2023-02-19 18:07:14 -08:00
|
|
|
def test_parse_cmdline(settngs_manager):
|
2022-12-14 19:42:24 -08:00
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=True))
|
|
|
|
|
2022-12-15 18:53:29 -08:00
|
|
|
normalized, _ = settngs_manager.parse_cmdline(['--test', 'success'])
|
|
|
|
|
|
|
|
assert 'test' in normalized['tst']
|
|
|
|
assert normalized['tst']['test'] == 'success'
|
|
|
|
|
|
|
|
|
2023-02-20 01:59:40 -08:00
|
|
|
namespaces = (
|
|
|
|
lambda definitions: settngs.Config({'tst': {'test': 'fail', 'test2': 'success'}}, definitions),
|
|
|
|
lambda definitions: settngs.Config(argparse.Namespace(tst_test='fail', tst_test2='success'), definitions),
|
|
|
|
lambda definitions: argparse.Namespace(tst_test='fail', tst_test2='success'),
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('ns', namespaces)
|
|
|
|
def test_parse_cmdline_with_namespace(settngs_manager, ns):
|
2022-12-15 18:53:29 -08:00
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=True))
|
2023-02-20 01:59:40 -08:00
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test2', default='fail', cmdline=True))
|
2022-12-15 18:53:29 -08:00
|
|
|
|
|
|
|
normalized, _ = settngs_manager.parse_cmdline(
|
2023-02-20 01:59:40 -08:00
|
|
|
['--test', 'success'], namespace=ns(settngs_manager.definitions),
|
2022-12-15 18:53:29 -08:00
|
|
|
)
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
assert 'test' in normalized['tst']
|
|
|
|
assert normalized['tst']['test'] == 'success'
|
2023-02-20 01:59:40 -08:00
|
|
|
assert normalized['tst']['test2'] == 'success'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_parse_file(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
2023-01-31 19:18:09 -08:00
|
|
|
settngs_file.write_text(json.dumps({'tst': {'test': 'success'}, 'persistent': {'hello': 'success'}}))
|
2022-12-14 19:42:24 -08:00
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=False))
|
2023-01-31 19:18:09 -08:00
|
|
|
settngs_manager.add_persistent_group('persistent', lambda parser: parser.add_setting('--world', default='world'))
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
normalized, success = settngs_manager.parse_file(settngs_file)
|
|
|
|
|
|
|
|
assert success
|
2022-12-15 18:53:29 -08:00
|
|
|
assert 'test' in normalized[0]['tst']
|
|
|
|
assert normalized[0]['tst']['test'] == 'success'
|
2023-01-31 19:18:09 -08:00
|
|
|
assert normalized[0]['persistent']['hello'] == 'success'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_parse_non_existent_file(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=False))
|
|
|
|
|
|
|
|
normalized, success = settngs_manager.parse_file(settngs_file)
|
|
|
|
|
2022-12-15 18:53:29 -08:00
|
|
|
assert success
|
|
|
|
assert 'test' in normalized[0]['tst']
|
|
|
|
assert normalized[0]['tst']['test'] == 'hello'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_parse_corrupt_file(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
|
|
|
settngs_file.write_text('{')
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=False))
|
|
|
|
|
|
|
|
normalized, success = settngs_manager.parse_file(settngs_file)
|
|
|
|
|
|
|
|
assert not success
|
2022-12-15 18:53:29 -08:00
|
|
|
assert 'test' in normalized[0]['tst']
|
|
|
|
assert normalized[0]['tst']['test'] == 'hello'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_save_file(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=False))
|
2023-01-31 19:18:09 -08:00
|
|
|
settngs_manager.add_persistent_group('persistent', lambda parser: parser.add_setting('--world', default='world'))
|
2022-12-15 18:53:29 -08:00
|
|
|
normalized, _ = settngs_manager.defaults()
|
2022-12-14 19:42:24 -08:00
|
|
|
normalized['tst']['test'] = 'success'
|
2023-01-31 19:18:09 -08:00
|
|
|
normalized['persistent']['hello'] = 'success'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
success = settngs_manager.save_file(normalized, settngs_file)
|
2023-01-31 19:18:09 -08:00
|
|
|
normalized_r, success_r = settngs_manager.parse_file(settngs_file)
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
assert success and success_r
|
2023-01-31 19:18:09 -08:00
|
|
|
assert 'test' in normalized_r[0]['tst']
|
|
|
|
assert normalized_r[0]['tst']['test'] == 'success'
|
|
|
|
assert normalized_r[0]['persistent']['hello'] == 'success'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_save_file_not_seriazable(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=False))
|
2022-12-15 18:53:29 -08:00
|
|
|
normalized, _ = settngs_manager.defaults()
|
2022-12-14 19:42:24 -08:00
|
|
|
normalized['tst']['test'] = {'fail'} # Sets are not serializabl
|
|
|
|
|
|
|
|
success = settngs_manager.save_file(normalized, settngs_file)
|
2023-01-31 19:18:09 -08:00
|
|
|
normalized_r, success_r = settngs_manager.parse_file(settngs_file)
|
|
|
|
# normalized_r will be the default settings
|
2022-12-14 19:42:24 -08:00
|
|
|
|
2023-01-31 19:18:09 -08:00
|
|
|
assert not success
|
|
|
|
assert not success_r
|
|
|
|
assert 'test' in normalized['tst']
|
|
|
|
assert normalized['tst']['test'] == {'fail'}
|
|
|
|
|
|
|
|
assert 'test' in normalized_r[0]['tst']
|
|
|
|
assert normalized_r[0]['tst']['test'] == 'hello'
|
2022-12-14 19:42:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
def test_cli_set(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
|
|
|
settngs_file.write_text(json.dumps({}))
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', file=False))
|
|
|
|
|
|
|
|
config, success = settngs_manager.parse_config(settngs_file, ['--test', 'success'])
|
|
|
|
normalized = config[0]
|
|
|
|
|
|
|
|
assert success
|
|
|
|
assert 'test' in normalized['tst']
|
|
|
|
assert normalized['tst']['test'] == 'success'
|
|
|
|
|
|
|
|
|
|
|
|
def test_file_set(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
|
|
|
settngs_file.write_text(json.dumps({'tst': {'test': 'success'}}))
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello', cmdline=False))
|
|
|
|
|
|
|
|
config, success = settngs_manager.parse_config(settngs_file, [])
|
|
|
|
normalized = config[0]
|
|
|
|
|
|
|
|
assert success
|
|
|
|
assert 'test' in normalized['tst']
|
|
|
|
assert normalized['tst']['test'] == 'success'
|
|
|
|
|
|
|
|
|
|
|
|
def test_cli_override_file(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
|
|
|
settngs_file.write_text(json.dumps({'tst': {'test': 'fail'}}))
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='hello'))
|
|
|
|
|
|
|
|
config, success = settngs_manager.parse_config(settngs_file, ['--test', 'success'])
|
|
|
|
normalized = config[0]
|
|
|
|
|
|
|
|
assert success
|
|
|
|
assert 'test' in normalized['tst']
|
|
|
|
assert normalized['tst']['test'] == 'success'
|
|
|
|
|
|
|
|
|
|
|
|
def test_cli_explicit_default(settngs_manager, tmp_path):
|
|
|
|
settngs_file = tmp_path / 'settngs.json'
|
|
|
|
settngs_file.write_text(json.dumps({'tst': {'test': 'fail'}}))
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='success'))
|
|
|
|
|
|
|
|
config, success = settngs_manager.parse_config(settngs_file, ['--test', 'success'])
|
|
|
|
normalized = config[0]
|
|
|
|
|
|
|
|
assert success
|
|
|
|
assert 'test' in normalized['tst']
|
|
|
|
assert normalized['tst']['test'] == 'success'
|
2022-12-15 18:53:29 -08:00
|
|
|
|
|
|
|
|
2023-02-19 18:07:14 -08:00
|
|
|
def test_adding_to_existing_group(settngs_manager, tmp_path):
|
|
|
|
def default_to_regular(d):
|
|
|
|
if isinstance(d, defaultdict):
|
|
|
|
d = {k: default_to_regular(v) for k, v in d.items()}
|
|
|
|
return d
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test', default='success'))
|
|
|
|
settngs_manager.add_group('tst', lambda parser: parser.add_setting('--test2', default='success'))
|
|
|
|
|
|
|
|
def tst(parser):
|
|
|
|
parser.add_setting('--test', default='success')
|
|
|
|
parser.add_setting('--test2', default='success')
|
|
|
|
|
|
|
|
settngs_manager2 = settngs.Manager()
|
|
|
|
settngs_manager2.add_group('tst', tst)
|
|
|
|
|
|
|
|
assert default_to_regular(settngs_manager.definitions) == default_to_regular(settngs_manager2.definitions)
|
|
|
|
|
|
|
|
|
|
|
|
def test_adding_to_existing_persistent_group(settngs_manager, tmp_path):
|
|
|
|
def default_to_regular(d):
|
|
|
|
if isinstance(d, defaultdict):
|
|
|
|
d = {k: default_to_regular(v) for k, v in d.items()}
|
|
|
|
return d
|
|
|
|
settngs_manager.add_persistent_group('tst', lambda parser: parser.add_setting('--test', default='success'))
|
|
|
|
settngs_manager.add_persistent_group('tst', lambda parser: parser.add_setting('--test2', default='success'))
|
|
|
|
|
|
|
|
def tst(parser):
|
|
|
|
parser.add_setting('--test', default='success')
|
|
|
|
parser.add_setting('--test2', default='success')
|
|
|
|
|
|
|
|
settngs_manager2 = settngs.Manager()
|
|
|
|
settngs_manager2.add_persistent_group('tst', tst)
|
|
|
|
|
|
|
|
assert default_to_regular(settngs_manager.definitions) == default_to_regular(settngs_manager2.definitions)
|
|
|
|
|
|
|
|
|
2022-12-15 18:53:29 -08:00
|
|
|
def test_example(capsys, tmp_path, monkeypatch):
|
|
|
|
monkeypatch.chdir(tmp_path)
|
|
|
|
settings_file = tmp_path / 'settings.json'
|
|
|
|
settings_file.touch()
|
|
|
|
|
2023-01-31 19:18:09 -08:00
|
|
|
i = 0
|
2022-12-15 18:53:29 -08:00
|
|
|
for args, expected_out, expected_file in example:
|
2023-01-31 19:18:09 -08:00
|
|
|
if args == ['manual settings.json']:
|
|
|
|
settings_file.unlink()
|
|
|
|
settings_file.write_text('{\n "example": {\n "hello": "lordwelch",\n "verbose": true\n },\n "persistent": {\n "test": false,\n "hello": "world"\n }\n}\n')
|
|
|
|
else:
|
|
|
|
settngs._main(args)
|
|
|
|
captured = capsys.readouterr()
|
|
|
|
assert captured.out == expected_out, f'{i}, {args}'
|
|
|
|
assert settings_file.read_text() == expected_file, f'{i}, {args}'
|
|
|
|
i += 1
|