mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-12 17:38:32 +02:00
Formatting
This commit is contained in:
parent
9b2805e948
commit
9bb92707d0
2 changed files with 22 additions and 9 deletions
|
@ -85,13 +85,14 @@ def we_have_type_of_keyring(keyring_type):
|
||||||
|
|
||||||
@given(parse("we use no config"), target_fixture="config_path")
|
@given(parse("we use no config"), target_fixture="config_path")
|
||||||
def we_use_no_config(temp_dir):
|
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")
|
return os.path.join(temp_dir.name, "non_existing_config.yaml")
|
||||||
|
|
||||||
|
|
||||||
@given(parse('we use the config "{config_file}"'), target_fixture="config_path")
|
@given(parse('we use the config "{config_file}"'), target_fixture="config_path")
|
||||||
def we_use_the_config(request, temp_dir, working_dir, config_file):
|
def we_use_the_config(request, temp_dir, working_dir, config_file):
|
||||||
# Move into temp dir as cwd
|
# 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
|
# Copy the config file over
|
||||||
config_source = os.path.join(working_dir, "data", "configs", config_file)
|
config_source = os.path.join(working_dir, "data", "configs", config_file)
|
||||||
|
|
|
@ -258,9 +258,12 @@ def journal_directory_should_not_exist(config_on_disk, journal_name):
|
||||||
), f'Journal "{journal_name}" does exist'
|
), f'Journal "{journal_name}" does exist'
|
||||||
|
|
||||||
|
|
||||||
@then(parse("the journal {should_or_should_not:ShouldOrShouldNot} exist",
|
@then(
|
||||||
dict(ShouldOrShouldNot=should_or_should_not_choice),
|
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):
|
def journal_should_not_exist(config_on_disk, should_or_should_not):
|
||||||
scoped_config = scope_config(config_on_disk, "default")
|
scoped_config = scope_config(config_on_disk, "default")
|
||||||
expected_path = scoped_config["journal"]
|
expected_path = scoped_config["journal"]
|
||||||
|
@ -416,11 +419,16 @@ def count_elements(number, item, cli_run):
|
||||||
assert len(xml_tree.findall(".//" + item)) == number
|
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(
|
@then(
|
||||||
parse(
|
parse(
|
||||||
"the editor {should_or_should_not:ShouldOrShouldNot} have been called with {num_args} arguments",
|
"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):
|
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)
|
assert len(editor_state["command"]) == int(num_args)
|
||||||
|
|
||||||
|
|
||||||
@then(parse("the stdin prompt {should_or_should_not:ShouldOrShouldNot} have been called",
|
@then(
|
||||||
dict(ShouldOrShouldNot=should_or_should_not_choice)))
|
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):
|
def stdin_prompt_called(cli_run, should_or_should_not):
|
||||||
assert cli_run["mocks"]["stdin_input"].called == should_or_should_not
|
assert cli_run["mocks"]["stdin_input"].called == should_or_should_not
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue