update tests

This commit is contained in:
Sina Atalay 2024-02-20 20:16:57 +01:00
parent 0821ab9a94
commit afaf603c3f
3 changed files with 10 additions and 2 deletions

View File

@ -61,7 +61,7 @@ def rendercv_data_model() -> dm.RenderCVDataModel:
@pytest.fixture
def rendercv_empty_curriculum_vitae_data_model() -> dm.CurriculumVitae:
return dm.CurriculumVitae(name="John Doe")
return dm.CurriculumVitae()
@pytest.fixture

View File

@ -177,6 +177,13 @@ def test_render_command(tmp_path, input_file_path):
assert "Your CV is rendered!" in result.stdout
def test_render_command_with_use_local_latex_option(tmp_path, input_file_path):
# copy input file to the temporary directory to create the output directory there:
input_file_path = shutil.copy(input_file_path, tmp_path)
runner.invoke(cli.app, ["render", str(input_file_path), "--use-local-latex"])
def test_new_command(tmp_path):
# change the current working directory to the temporary directory:
os.chdir(tmp_path)

View File

@ -86,7 +86,7 @@ def test_transform_markdown_sections_to_latex_sections(rendercv_data_model):
@pytest.mark.parametrize(
"string, placeholders, expected_string",
[
("Hello, {name}!", {"{name}": "World"}, "Hello, World!"),
("Hello, {name}!", {"{name}": None}, "Hello, World!"),
(
"{greeting}, {name}!",
{"{greeting}": "Hello", "{name}": "World"},
@ -188,6 +188,7 @@ def test_make_matched_part_non_line_breakable(value, match_str, expected):
("John Jacob Jingleheimer Schmidt", "J. J. J. Schmidt"),
("SingleName", "SingleName"),
("", ""),
(None, ""),
],
)
def test_abbreviate_name(name, expected):