tests: don't import generate_entry_figures_and_examples

This commit is contained in:
Sina Atalay 2024-02-27 20:05:06 +01:00
parent 38e1ccbdfe
commit c842a7ad70
1 changed files with 64 additions and 23 deletions

View File

@ -1,7 +1,4 @@
import pathlib import pathlib
import importlib
import importlib.machinery
import importlib.util
import jinja2 import jinja2
import pytest import pytest
@ -11,47 +8,91 @@ import rendercv.renderer as r
update_auxiliary_files = False update_auxiliary_files = False
# import docs/generate_entry_figures_and_examples.py to get example entries (SSOT) # copy sample entries from docs/generate_entry_figures_and_examples.py:
path = ( education_entry = {
pathlib.Path(__file__).parent.parent "institution": "Boğaziçi University",
/ "docs" "location": "Istanbul, Turkey",
/ "generate_entry_figures_and_examples.py" "degree": "BS",
) "area": "Mechanical Engineering",
spec = importlib.util.spec_from_file_location( "start_date": "2015-09",
"generate_entry_figures_and_examples", path "end_date": "2020-06",
) "highlights": [
generate_entry_figures_and_examples = importlib.util.module_from_spec(spec) # type: ignore "GPA: 3.24/4.00 ([Transcript](https://example.com))",
spec.loader.exec_module(generate_entry_figures_and_examples) # type: ignore "Awards: Dean's Honor List, Sportsperson of the Year",
],
folder_name_dictionary = {
"rendercv_empty_curriculum_vitae_data_model": "empty",
"rendercv_filled_curriculum_vitae_data_model": "filled",
} }
experience_entry = {
"company": "Some Company",
"location": "TX, USA",
"position": "Software Engineer",
"start_date": "2020-07",
"end_date": "2021-08-12",
"highlights": [
(
"Developed an [IOS application](https://example.com) that has received"
" more than **100,000 downloads**."
),
"Managed a team of **5** engineers.",
],
}
normal_entry = {
"name": "Some Project",
"location": "Remote",
"date": "2021-09",
"highlights": [
"Developed a web application with **React** and **Django**.",
"Implemented a **RESTful API**",
],
}
publication_entry = {
"title": (
"Magneto-Thermal Thin Shell Approximation for 3D Finite Element Analysis of"
" No-Insulation Coils"
),
"authors": ["John Doe", "Harry Tom", "Sina Doe", "Anotherfirstname Andsurname"],
"date": "2021-12-08",
"journal": "IEEE Transactions on Applied Superconductivity",
"doi": "10.1109/TASC.2023.3340648",
}
one_line_entry = {
"name": "Programming",
"details": "Python, C++, JavaScript, MATLAB",
}
text_entry = (
"This is a *TextEntry*. It is only a text and can be useful for sections like"
" **Summary**. To showcase the TextEntry completely, this sentence is added, but it"
" doesn't contain any information."
)
@pytest.fixture @pytest.fixture
def publication_entry() -> dict[str, str | list[str]]: def publication_entry() -> dict[str, str | list[str]]:
return generate_entry_figures_and_examples.publication_entry return publication_entry
@pytest.fixture @pytest.fixture
def experience_entry() -> dict[str, str]: def experience_entry() -> dict[str, str]:
return generate_entry_figures_and_examples.experience_entry return experience_entry
@pytest.fixture @pytest.fixture
def education_entry() -> dict[str, str]: def education_entry() -> dict[str, str]:
return generate_entry_figures_and_examples.education_entry return education_entry
@pytest.fixture @pytest.fixture
def normal_entry() -> dict[str, str]: def normal_entry() -> dict[str, str]:
return generate_entry_figures_and_examples.normal_entry return normal_entry
@pytest.fixture @pytest.fixture
def one_line_entry() -> dict[str, str]: def one_line_entry() -> dict[str, str]:
return generate_entry_figures_and_examples.one_line_entry return one_line_entry
@pytest.fixture @pytest.fixture