mirror of https://github.com/eyhc1/rendercv.git
tests: add more tests
This commit is contained in:
parent
07f0dcf52d
commit
80269cfb01
|
@ -93,11 +93,20 @@ def test_read_input_file_invalid_file(tmp_path):
|
|||
dm.read_input_file(invalid_file_path)
|
||||
|
||||
|
||||
def test_get_a_sample_data_model():
|
||||
data_model = dm.get_a_sample_data_model("John Doe")
|
||||
@pytest.mark.parametrize(
|
||||
"theme",
|
||||
dm.available_themes,
|
||||
)
|
||||
def test_get_a_sample_data_model(theme):
|
||||
data_model = dm.get_a_sample_data_model("John Doe", theme)
|
||||
assert isinstance(data_model, dm.RenderCVDataModel)
|
||||
|
||||
|
||||
def test_get_a_sample_data_model_invalid_theme():
|
||||
with pytest.raises(ValueError):
|
||||
dm.get_a_sample_data_model("John Doe", "invalid")
|
||||
|
||||
|
||||
def test_generate_json_schema():
|
||||
schema = dm.generate_json_schema()
|
||||
assert isinstance(schema, dict)
|
||||
|
|
|
@ -416,6 +416,11 @@ def test_copy_theme_files_to_output_directory_custom_theme(
|
|||
pathlib.Path(custom_theme_directory_path / "theme_auxiliary_dir").mkdir(
|
||||
exist_ok=True
|
||||
)
|
||||
pathlib.Path(
|
||||
custom_theme_directory_path
|
||||
/ "theme_auxiliary_dir"
|
||||
/ "theme_auxiliary_file.txt"
|
||||
).touch()
|
||||
init_file = pathlib.Path(custom_theme_directory_path / "__init__.py")
|
||||
|
||||
init_file.touch()
|
||||
|
|
Loading…
Reference in New Issue