mirror of https://github.com/eyhc1/rendercv.git
tests: refactor conftest.py
This commit is contained in:
parent
a344b68598
commit
c72ceec618
|
@ -73,7 +73,9 @@ one_line_entry_dictionary = {
|
||||||
}
|
}
|
||||||
|
|
||||||
bullet_entry_dictionary = {
|
bullet_entry_dictionary = {
|
||||||
"bullet": "This is a bullet entry.",
|
"bullet": (
|
||||||
|
"My Bullet Entry with some **markdown** and [links](https://example.com)!"
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,7 +111,7 @@ def bullet_entry() -> dict[str, str]:
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def text_entry() -> str:
|
def text_entry() -> str:
|
||||||
return "My Text Entry with some **markdown** and [links](https://example.com)!"
|
return ("My Text Entry with some **markdown** and [links](https://example.com)!",)
|
||||||
|
|
||||||
|
|
||||||
def return_a_value_for_a_field_type(
|
def return_a_value_for_a_field_type(
|
||||||
|
@ -212,72 +214,9 @@ def create_combinations_of_a_model(
|
||||||
return all_combinations
|
return all_combinations
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def all_combinations_of_text_entries() -> list[str]:
|
|
||||||
return [
|
|
||||||
"My Text Entry with some **markdown** and [links](https://example.com)!",
|
|
||||||
"My Text Entry with some **markdown** and [links](https://example.com)!",
|
|
||||||
"Some other *** tests, which should be tricky* to parse!**",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def all_combinations_of_bullet_entries() -> list[dict[str, str]]:
|
|
||||||
return [
|
|
||||||
{"bullet": "This is a bullet entry."},
|
|
||||||
{
|
|
||||||
"bullet": (
|
|
||||||
"My Text Entry with some **markdown** and [links](https://example.com)!"
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{"bullet": "Some other *** tests, which should be tricky* to parse!**"},
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def all_combinations_of_one_line_entries() -> list[dict[str, str]]:
|
|
||||||
return create_combinations_of_a_model(dm.OneLineEntry)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def all_combinations_of_normal_entries() -> list[dict[str, str]]:
|
|
||||||
return create_combinations_of_a_model(dm.NormalEntry)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def all_combinations_of_education_entries() -> list[dict[str, str]]:
|
|
||||||
return create_combinations_of_a_model(dm.EducationEntry)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def all_combinations_of_experience_entries() -> list[dict[str, str]]:
|
|
||||||
return create_combinations_of_a_model(dm.ExperienceEntry)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def all_combinations_of_publication_entries() -> list[dict[str, str | list[str]]]:
|
|
||||||
return create_combinations_of_a_model(dm.PublicationEntry)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def rendercv_data_model() -> dm.RenderCVDataModel:
|
|
||||||
return dm.get_a_sample_data_model()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def rendercv_empty_curriculum_vitae_data_model() -> dm.CurriculumVitae:
|
|
||||||
return dm.CurriculumVitae(sections={"test": ["test"]})
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def rendercv_filled_curriculum_vitae_data_model(
|
def rendercv_filled_curriculum_vitae_data_model(
|
||||||
text_entry,
|
text_entry, bullet_entry
|
||||||
all_combinations_of_publication_entries,
|
|
||||||
all_combinations_of_experience_entries,
|
|
||||||
all_combinations_of_education_entries,
|
|
||||||
all_combinations_of_normal_entries,
|
|
||||||
all_combinations_of_one_line_entries,
|
|
||||||
all_combinations_of_bullet_entries,
|
|
||||||
) -> dm.CurriculumVitae:
|
) -> dm.CurriculumVitae:
|
||||||
return dm.CurriculumVitae(
|
return dm.CurriculumVitae(
|
||||||
name="John Doe",
|
name="John Doe",
|
||||||
|
@ -295,17 +234,13 @@ def rendercv_filled_curriculum_vitae_data_model(
|
||||||
dm.SocialNetwork(network="Twitter", username="johndoe"),
|
dm.SocialNetwork(network="Twitter", username="johndoe"),
|
||||||
],
|
],
|
||||||
sections={
|
sections={
|
||||||
"Text Entries": [
|
"Text Entries": [text_entry, text_entry, text_entry],
|
||||||
text_entry,
|
"Bullet Entries": [bullet_entry, bullet_entry],
|
||||||
text_entry,
|
"Publication Entries": create_combinations_of_a_model(dm.PublicationEntry),
|
||||||
"Some other *** tests, which should be tricky* to parse!**",
|
"Experience Entries": create_combinations_of_a_model(dm.ExperienceEntry),
|
||||||
],
|
"Education Entries": create_combinations_of_a_model(dm.EducationEntry),
|
||||||
"Bullet Entries": all_combinations_of_bullet_entries,
|
"Normal Entries": create_combinations_of_a_model(dm.NormalEntry),
|
||||||
"Publication Entries": all_combinations_of_publication_entries,
|
"One Line Entries": create_combinations_of_a_model(dm.OneLineEntry),
|
||||||
"Experience Entries": all_combinations_of_experience_entries,
|
|
||||||
"Education Entries": all_combinations_of_education_entries,
|
|
||||||
"Normal Entries": all_combinations_of_normal_entries,
|
|
||||||
"One Line Entries": all_combinations_of_one_line_entries,
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue