diff --git a/tests/lib/given_steps.py b/tests/lib/given_steps.py index dfb10615..c5fd62a1 100644 --- a/tests/lib/given_steps.py +++ b/tests/lib/given_steps.py @@ -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) diff --git a/tests/lib/then_steps.py b/tests/lib/then_steps.py index 506aab19..bdf48112 100644 --- a/tests/lib/then_steps.py +++ b/tests/lib/then_steps.py @@ -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