Fix mypy errors in the tests
The config values are now a TypedDict, so check inputs for None before sorting, use literal keys and use ConfigArgs as the fake _read_config() return type.
This commit is contained in:
@@ -85,6 +85,7 @@ keep=3
|
||||
|
||||
config_args = sb._read_config(config_file, USER)
|
||||
|
||||
assert config_args['inputs'] is not None
|
||||
assert sorted(config_args['inputs']) == [f'{tmp_path}/one', f'{tmp_path}/two']
|
||||
# Expanded later, as it may be a path on the server
|
||||
assert config_args['output'] == '~/backups'
|
||||
@@ -176,9 +177,9 @@ numeric_ids=
|
||||
|
||||
config_args = sb._read_config(config_file, USER)
|
||||
|
||||
for key in ['ssh_host', 'ssh_user', 'ssh_keyfile']:
|
||||
assert config_args[key] is None
|
||||
|
||||
assert config_args['ssh_host'] is None
|
||||
assert config_args['ssh_user'] is None
|
||||
assert config_args['ssh_keyfile'] is None
|
||||
assert config_args['remote_sudo'] is False
|
||||
assert config_args['numeric_ids'] is False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user