mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
fix linting issues
This commit is contained in:
parent
b495d63c14
commit
96661857f9
2 changed files with 6 additions and 6 deletions
|
@ -106,7 +106,7 @@ def scope_config(config: dict, journal_name: str) -> dict:
|
|||
return config
|
||||
config = config.copy()
|
||||
journal_conf = config["journals"].get(journal_name)
|
||||
if type(journal_conf) is dict:
|
||||
if isinstance(journal_conf, dict):
|
||||
# We can override the default config on a by-journal basis
|
||||
logging.debug(
|
||||
"Updating configuration with specific journal overrides:\n%s",
|
||||
|
@ -181,7 +181,7 @@ def update_config(
|
|||
"""Updates a config dict with new values - either global if scope is None
|
||||
or config['journals'][scope] is just a string pointing to a journal file,
|
||||
or within the scope"""
|
||||
if scope and type(config["journals"][scope]) is dict: # Update to journal specific
|
||||
if scope and isinstance(config["journals"][scope], dict):
|
||||
config["journals"][scope].update(new_config)
|
||||
elif scope and force_local: # Convert to dict
|
||||
config["journals"][scope] = {"journal": config["journals"][scope]}
|
||||
|
|
|
@ -161,7 +161,7 @@ def config_var_on_disk(config_on_disk, journal_name, it_should, some_yaml):
|
|||
expected = YAML(typ="safe").load(some_yaml)
|
||||
|
||||
actual_slice = actual
|
||||
if type(actual) is dict:
|
||||
if isinstance(actual, dict):
|
||||
# `expected` objects formatted in yaml only compare one level deep
|
||||
actual_slice = {key: actual.get(key) for key in expected.keys()}
|
||||
|
||||
|
@ -196,7 +196,7 @@ def config_var_in_memory(config_in_memory, journal_name, it_should, some_yaml):
|
|||
expected = YAML(typ="safe").load(some_yaml)
|
||||
|
||||
actual_slice = actual
|
||||
if type(actual) is dict:
|
||||
if isinstance(actual, dict):
|
||||
# `expected` objects formatted in yaml only compare one level deep
|
||||
actual_slice = {key: get_nested_val(actual, key) for key in expected.keys()}
|
||||
|
||||
|
@ -368,7 +368,7 @@ def assert_output_field_content(field_name, comparison, expected_keys, parsed_ou
|
|||
my_obj = my_obj[node]
|
||||
|
||||
if comparison == "be":
|
||||
if type(my_obj) is str:
|
||||
if isinstance(my_obj, str):
|
||||
assert expected_keys == my_obj, [my_obj, expected_keys]
|
||||
else:
|
||||
assert set(expected_keys) == set(my_obj), [
|
||||
|
@ -376,7 +376,7 @@ def assert_output_field_content(field_name, comparison, expected_keys, parsed_ou
|
|||
set(expected_keys),
|
||||
]
|
||||
elif comparison == "contain":
|
||||
if type(my_obj) is str:
|
||||
if isinstance(my_obj, str):
|
||||
assert expected_keys in my_obj, [my_obj, expected_keys]
|
||||
else:
|
||||
assert all(elem in my_obj for elem in expected_keys), [
|
||||
|
|
Loading…
Add table
Reference in a new issue