cli: fix created_files_and_folders_string

This commit is contained in:
Sina Atalay
2024-06-19 15:49:08 +03:00
parent 1353f6de4c
commit 0be6dad63b
2 changed files with 6 additions and 1 deletions

View File

@@ -842,6 +842,7 @@ def cli_command_new(
dm.create_a_sample_yaml_input_file(
input_file_path, name=full_name, theme=theme
)
created_files_and_folders.append(input_file_path.name)
except ValueError as e:
error(e)

View File

@@ -426,12 +426,16 @@ def test_render_command_with_invalid_arguments(
def test_new_command(tmp_path):
# change the current working directory to the temporary directory:
os.chdir(tmp_path)
runner.invoke(cli.app, ["new", "Jahn Doe"])
result = runner.invoke(cli.app, ["new", "Jahn Doe"])
markdown_source_files_path = tmp_path / "markdown"
theme_source_files_path = tmp_path / "classic"
input_file_path = tmp_path / "Jahn_Doe_CV.yaml"
assert "Jahn_Doe_CV.yaml" in result.stdout
assert "markdown" in result.stdout
assert "classic" in result.stdout
assert markdown_source_files_path.exists()
assert theme_source_files_path.exists()
assert input_file_path.exists()