Formatting

This commit is contained in:
Micah Jerome Ellison 2023-02-20 13:57:18 -08:00
parent 9b2805e948
commit 9bb92707d0
2 changed files with 22 additions and 9 deletions

View file

@ -85,13 +85,14 @@ def we_have_type_of_keyring(keyring_type):
@given(parse("we use no config"), target_fixture="config_path")
def we_use_no_config(temp_dir):
os.chdir(temp_dir.name) # @todo move this step to a more universal place
os.chdir(temp_dir.name) # @todo move this step to a more universal place
return os.path.join(temp_dir.name, "non_existing_config.yaml")
@given(parse('we use the config "{config_file}"'), target_fixture="config_path")
def we_use_the_config(request, temp_dir, working_dir, config_file):
# Move into temp dir as cwd
os.chdir(temp_dir.name) # @todo move this step to a more universal place
os.chdir(temp_dir.name) # @todo move this step to a more universal place
# Copy the config file over
config_source = os.path.join(working_dir, "data", "configs", config_file)

View file

@ -258,9 +258,12 @@ def journal_directory_should_not_exist(config_on_disk, journal_name):
), f'Journal "{journal_name}" does exist'
@then(parse("the journal {should_or_should_not:ShouldOrShouldNot} exist",
dict(ShouldOrShouldNot=should_or_should_not_choice),
))
@then(
parse(
"the journal {should_or_should_not:ShouldOrShouldNot} exist",
dict(ShouldOrShouldNot=should_or_should_not_choice),
)
)
def journal_should_not_exist(config_on_disk, should_or_should_not):
scoped_config = scope_config(config_on_disk, "default")
expected_path = scoped_config["journal"]
@ -416,11 +419,16 @@ def count_elements(number, item, cli_run):
assert len(xml_tree.findall(".//" + item)) == number
@then(parse("the editor {should_or_should_not:ShouldOrShouldNot} have been called", dict(ShouldOrShouldNot=should_or_should_not_choice)))
@then(
parse(
"the editor {should_or_should_not:ShouldOrShouldNot} have been called",
dict(ShouldOrShouldNot=should_or_should_not_choice),
)
)
@then(
parse(
"the editor {should_or_should_not:ShouldOrShouldNot} have been called with {num_args} arguments",
dict(ShouldOrShouldNot=should_or_should_not_choice)
dict(ShouldOrShouldNot=should_or_should_not_choice),
)
)
def count_editor_args(num_args, cli_run, editor_state, should_or_should_not):
@ -430,8 +438,12 @@ def count_editor_args(num_args, cli_run, editor_state, should_or_should_not):
assert len(editor_state["command"]) == int(num_args)
@then(parse("the stdin prompt {should_or_should_not:ShouldOrShouldNot} have been called",
dict(ShouldOrShouldNot=should_or_should_not_choice)))
@then(
parse(
"the stdin prompt {should_or_should_not:ShouldOrShouldNot} have been called",
dict(ShouldOrShouldNot=should_or_should_not_choice),
)
)
def stdin_prompt_called(cli_run, should_or_should_not):
assert cli_run["mocks"]["stdin_input"].called == should_or_should_not