mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-12 09:28:31 +02:00
Formatting
This commit is contained in:
parent
9b2805e948
commit
9bb92707d0
2 changed files with 22 additions and 9 deletions
|
@ -88,6 +88,7 @@ def we_use_no_config(temp_dir):
|
|||
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
|
||||
|
|
|
@ -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",
|
||||
@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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue