From c842a7ad7085dcccef5b307e1a343bdaaa8e0a95 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Tue, 27 Feb 2024 20:05:06 +0100 Subject: [PATCH] tests: don't import generate_entry_figures_and_examples --- tests/conftest.py | 87 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 23 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 825ffd5..513e899 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,4 @@ import pathlib -import importlib -import importlib.machinery -import importlib.util import jinja2 import pytest @@ -11,47 +8,91 @@ import rendercv.renderer as r update_auxiliary_files = False -# import docs/generate_entry_figures_and_examples.py to get example entries (SSOT) -path = ( - pathlib.Path(__file__).parent.parent - / "docs" - / "generate_entry_figures_and_examples.py" -) -spec = importlib.util.spec_from_file_location( - "generate_entry_figures_and_examples", path -) -generate_entry_figures_and_examples = importlib.util.module_from_spec(spec) # type: ignore -spec.loader.exec_module(generate_entry_figures_and_examples) # type: ignore - -folder_name_dictionary = { - "rendercv_empty_curriculum_vitae_data_model": "empty", - "rendercv_filled_curriculum_vitae_data_model": "filled", +# copy sample entries from docs/generate_entry_figures_and_examples.py: +education_entry = { + "institution": "Boğaziçi University", + "location": "Istanbul, Turkey", + "degree": "BS", + "area": "Mechanical Engineering", + "start_date": "2015-09", + "end_date": "2020-06", + "highlights": [ + "GPA: 3.24/4.00 ([Transcript](https://example.com))", + "Awards: Dean's Honor List, Sportsperson of the Year", + ], } +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 def publication_entry() -> dict[str, str | list[str]]: - return generate_entry_figures_and_examples.publication_entry + return publication_entry @pytest.fixture def experience_entry() -> dict[str, str]: - return generate_entry_figures_and_examples.experience_entry + return experience_entry @pytest.fixture def education_entry() -> dict[str, str]: - return generate_entry_figures_and_examples.education_entry + return education_entry @pytest.fixture def normal_entry() -> dict[str, str]: - return generate_entry_figures_and_examples.normal_entry + return normal_entry @pytest.fixture def one_line_entry() -> dict[str, str]: - return generate_entry_figures_and_examples.one_line_entry + return one_line_entry @pytest.fixture