diff --git a/tests/auxiliary_files/test_generate_latex_file/classic_empty/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file/classic_empty/None_CV.tex similarity index 93% rename from tests/auxiliary_files/test_generate_latex_file/classic_empty/John_Doe_CV.tex rename to tests/auxiliary_files/test_generate_latex_file/classic_empty/None_CV.tex index cdbb70f..3bd0b44 100644 --- a/tests/auxiliary_files/test_generate_latex_file/classic_empty/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file/classic_empty/None_CV.tex @@ -18,8 +18,8 @@ \usepackage{enumitem} % for customizing lists \usepackage{fontawesome5} % for using icons \usepackage[ - pdftitle={John Doe's CV}, - pdfauthor={John Doe}, + pdftitle={None's CV}, + pdfauthor={None}, colorlinks=true, urlcolor=primaryColor ]{hyperref} % for links, metadata and bookmarks @@ -38,7 +38,7 @@ \makeatletter \let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle \patchcmd{\ps@customFooterStyle}{\thepage}{ - \color{gray}\textit{\small John Doe - Page \thepage{} of \pageref*{LastPage}} + \color{gray}\textit{\small None - Page \thepage{} of \pageref*{LastPage}} }{}{} % replace number by desired string \makeatother \pagestyle{customFooterStyle} @@ -125,16 +125,17 @@ \begin{document} \placelastupdatedtext - \begin{header} - \fontsize{30 pt}{30 pt} - \textbf{John Doe} - \vspace{0.3 cm} + \section{Test} - \normalsize - \end{header} + \begin{changemargin}{0.2 cm}{0.2 cm} + test + \end{changemargin} - \vspace{0.3 cm} + + + + \end{document} \ No newline at end of file diff --git a/tests/auxiliary_files/test_generate_latex_file/classic_filled/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file/classic_filled/John_Doe_CV.tex index e02edf5..6eebc50 100644 --- a/tests/auxiliary_files/test_generate_latex_file/classic_filled/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file/classic_filled/John_Doe_CV.tex @@ -124,7 +124,6 @@ \begin{document} \placelastupdatedtext - \begin{header} \fontsize{30 pt}{30 pt} \hrefWithoutArrow{https://orcid.org/0000-0000-0000-0000}{\textbf{John Doe}} @@ -152,6 +151,7 @@ \vspace{0.3 cm} + \section{Section1} \begin{changemargin}{0.2 cm}{0.2 cm} diff --git a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_empty/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file/moderncv_empty/None_CV.tex similarity index 97% rename from tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_empty/John_Doe_CV.tex rename to tests/auxiliary_files/test_generate_latex_file/moderncv_empty/None_CV.tex index d82f215..371bf1b 100644 --- a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_empty/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file/moderncv_empty/None_CV.tex @@ -37,7 +37,7 @@ \usepackage[english]{babel} % FIXME: using spanish breaks moderncv % personal data -\name{John Doe}{} +\name{None}{} % \familyname{} % Social icons @@ -59,12 +59,18 @@ % \social[googlescholar]{googlescholarid} % optional, remove / comment the line if not wanted \begin{document} - \maketitle + % save the original href command in a new command: \let\hrefWithoutArrow\href % new command for external links: \renewcommand{\href}[2]{\hrefWithoutArrow{#1}{\mbox{\color{color1} #2 \raisebox{.15ex}{\footnotesize \faExternalLink*}}}} + \section{Test} + + \cvlistitem{test} + + + \end{document} \ No newline at end of file diff --git a/tests/auxiliary_files/test_generate_latex_file/moderncv_filled/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file/moderncv_filled/John_Doe_CV.tex index 285564a..32f567f 100644 --- a/tests/auxiliary_files/test_generate_latex_file/moderncv_filled/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file/moderncv_filled/John_Doe_CV.tex @@ -69,6 +69,7 @@ \begin{document} \maketitle + % save the original href command in a new command: \let\hrefWithoutArrow\href % new command for external links: diff --git a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/sb2nov_empty/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file/sb2nov_empty/None_CV.tex similarity index 91% rename from tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/sb2nov_empty/John_Doe_CV.tex rename to tests/auxiliary_files/test_generate_latex_file/sb2nov_empty/None_CV.tex index c9afb74..3043f2d 100644 --- a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/sb2nov_empty/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file/sb2nov_empty/None_CV.tex @@ -35,7 +35,7 @@ \pagestyle{fancy} \fancyhf{} % clear all header and footer fields -\fancyfoot[CO]{\color{gray}\textit{\small John Doe - Page \thepage{} of \pageref*{LastPage}}} +\fancyfoot[CO]{\color{gray}\textit{\small None - Page \thepage{} of \pageref*{LastPage}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} @@ -120,26 +120,18 @@ \begin{document} \placelastupdatedtext - { - \centering - \textbf{\fontsize{24 pt}{24 pt}\selectfont - John Doe - } \\ \vspace{3pt} - \small - - \vspace{0.3 cm} - - \begin{spacing}{1.6} - \end{spacing} - \par - } - - \vspace{0.3 cm} % save the original href command in a new command: \let\hrefWithoutArrow\href % new command for external links: \renewcommand{\href}[2]{\hrefWithoutArrow{#1}{\color{primaryColor}\mbox{\ifthenelse{\equal{#2}{}}{}{#2 }\raisebox{.15ex}{\footnotesize \faExternalLink*}}}} + \section{Test} + \resumeSubHeadingListStart + + \resumeSubItem{}{test} + + + \resumeSubHeadingListEnd \end{document} \ No newline at end of file diff --git a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_empty/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_empty/None_CV.tex similarity index 93% rename from tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_empty/John_Doe_CV.tex rename to tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_empty/None_CV.tex index cdbb70f..3bd0b44 100644 --- a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_empty/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_empty/None_CV.tex @@ -18,8 +18,8 @@ \usepackage{enumitem} % for customizing lists \usepackage{fontawesome5} % for using icons \usepackage[ - pdftitle={John Doe's CV}, - pdfauthor={John Doe}, + pdftitle={None's CV}, + pdfauthor={None}, colorlinks=true, urlcolor=primaryColor ]{hyperref} % for links, metadata and bookmarks @@ -38,7 +38,7 @@ \makeatletter \let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle \patchcmd{\ps@customFooterStyle}{\thepage}{ - \color{gray}\textit{\small John Doe - Page \thepage{} of \pageref*{LastPage}} + \color{gray}\textit{\small None - Page \thepage{} of \pageref*{LastPage}} }{}{} % replace number by desired string \makeatother \pagestyle{customFooterStyle} @@ -125,16 +125,17 @@ \begin{document} \placelastupdatedtext - \begin{header} - \fontsize{30 pt}{30 pt} - \textbf{John Doe} - \vspace{0.3 cm} + \section{Test} - \normalsize - \end{header} + \begin{changemargin}{0.2 cm}{0.2 cm} + test + \end{changemargin} - \vspace{0.3 cm} + + + + \end{document} \ No newline at end of file diff --git a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_filled/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_filled/John_Doe_CV.tex index e02edf5..6eebc50 100644 --- a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_filled/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/classic_filled/John_Doe_CV.tex @@ -124,7 +124,6 @@ \begin{document} \placelastupdatedtext - \begin{header} \fontsize{30 pt}{30 pt} \hrefWithoutArrow{https://orcid.org/0000-0000-0000-0000}{\textbf{John Doe}} @@ -152,6 +151,7 @@ \vspace{0.3 cm} + \section{Section1} \begin{changemargin}{0.2 cm}{0.2 cm} diff --git a/tests/auxiliary_files/test_generate_latex_file/moderncv_empty/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_empty/None_CV.tex similarity index 97% rename from tests/auxiliary_files/test_generate_latex_file/moderncv_empty/John_Doe_CV.tex rename to tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_empty/None_CV.tex index d82f215..371bf1b 100644 --- a/tests/auxiliary_files/test_generate_latex_file/moderncv_empty/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_empty/None_CV.tex @@ -37,7 +37,7 @@ \usepackage[english]{babel} % FIXME: using spanish breaks moderncv % personal data -\name{John Doe}{} +\name{None}{} % \familyname{} % Social icons @@ -59,12 +59,18 @@ % \social[googlescholar]{googlescholarid} % optional, remove / comment the line if not wanted \begin{document} - \maketitle + % save the original href command in a new command: \let\hrefWithoutArrow\href % new command for external links: \renewcommand{\href}[2]{\hrefWithoutArrow{#1}{\mbox{\color{color1} #2 \raisebox{.15ex}{\footnotesize \faExternalLink*}}}} + \section{Test} + + \cvlistitem{test} + + + \end{document} \ No newline at end of file diff --git a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_filled/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_filled/John_Doe_CV.tex index 285564a..32f567f 100644 --- a/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_filled/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/moderncv_filled/John_Doe_CV.tex @@ -69,6 +69,7 @@ \begin{document} \maketitle + % save the original href command in a new command: \let\hrefWithoutArrow\href % new command for external links: diff --git a/tests/auxiliary_files/test_generate_latex_file/sb2nov_empty/John_Doe_CV.tex b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/sb2nov_empty/None_CV.tex similarity index 91% rename from tests/auxiliary_files/test_generate_latex_file/sb2nov_empty/John_Doe_CV.tex rename to tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/sb2nov_empty/None_CV.tex index c9afb74..3043f2d 100644 --- a/tests/auxiliary_files/test_generate_latex_file/sb2nov_empty/John_Doe_CV.tex +++ b/tests/auxiliary_files/test_generate_latex_file_and_copy_theme_files/sb2nov_empty/None_CV.tex @@ -35,7 +35,7 @@ \pagestyle{fancy} \fancyhf{} % clear all header and footer fields -\fancyfoot[CO]{\color{gray}\textit{\small John Doe - Page \thepage{} of \pageref*{LastPage}}} +\fancyfoot[CO]{\color{gray}\textit{\small None - Page \thepage{} of \pageref*{LastPage}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} @@ -120,26 +120,18 @@ \begin{document} \placelastupdatedtext - { - \centering - \textbf{\fontsize{24 pt}{24 pt}\selectfont - John Doe - } \\ \vspace{3pt} - \small - - \vspace{0.3 cm} - - \begin{spacing}{1.6} - \end{spacing} - \par - } - - \vspace{0.3 cm} % save the original href command in a new command: \let\hrefWithoutArrow\href % new command for external links: \renewcommand{\href}[2]{\hrefWithoutArrow{#1}{\color{primaryColor}\mbox{\ifthenelse{\equal{#2}{}}{}{#2 }\raisebox{.15ex}{\footnotesize \faExternalLink*}}}} + \section{Test} + \resumeSubHeadingListStart + + \resumeSubItem{}{test} + + + \resumeSubHeadingListEnd \end{document} \ No newline at end of file diff --git a/tests/auxiliary_files/test_generate_markdown_file/classic_empty/John_Doe_CV.md b/tests/auxiliary_files/test_generate_markdown_file/classic_empty/John_Doe_CV.md deleted file mode 100644 index 03dc986..0000000 --- a/tests/auxiliary_files/test_generate_markdown_file/classic_empty/John_Doe_CV.md +++ /dev/null @@ -1,4 +0,0 @@ -# John Doe's CV - - - diff --git a/tests/auxiliary_files/test_generate_markdown_file/classic_empty/None_CV.md b/tests/auxiliary_files/test_generate_markdown_file/classic_empty/None_CV.md new file mode 100644 index 0000000..49fbab0 --- /dev/null +++ b/tests/auxiliary_files/test_generate_markdown_file/classic_empty/None_CV.md @@ -0,0 +1,7 @@ +# None's CV + + + +# Test + +test diff --git a/tests/auxiliary_files/test_generate_markdown_file/moderncv_empty/John_Doe_CV.md b/tests/auxiliary_files/test_generate_markdown_file/moderncv_empty/John_Doe_CV.md deleted file mode 100644 index 03dc986..0000000 --- a/tests/auxiliary_files/test_generate_markdown_file/moderncv_empty/John_Doe_CV.md +++ /dev/null @@ -1,4 +0,0 @@ -# John Doe's CV - - - diff --git a/tests/auxiliary_files/test_generate_markdown_file/moderncv_empty/None_CV.md b/tests/auxiliary_files/test_generate_markdown_file/moderncv_empty/None_CV.md new file mode 100644 index 0000000..49fbab0 --- /dev/null +++ b/tests/auxiliary_files/test_generate_markdown_file/moderncv_empty/None_CV.md @@ -0,0 +1,7 @@ +# None's CV + + + +# Test + +test diff --git a/tests/auxiliary_files/test_generate_markdown_file/sb2nov_empty/John_Doe_CV.md b/tests/auxiliary_files/test_generate_markdown_file/sb2nov_empty/John_Doe_CV.md deleted file mode 100644 index 03dc986..0000000 --- a/tests/auxiliary_files/test_generate_markdown_file/sb2nov_empty/John_Doe_CV.md +++ /dev/null @@ -1,4 +0,0 @@ -# John Doe's CV - - - diff --git a/tests/auxiliary_files/test_generate_markdown_file/sb2nov_empty/None_CV.md b/tests/auxiliary_files/test_generate_markdown_file/sb2nov_empty/None_CV.md new file mode 100644 index 0000000..49fbab0 --- /dev/null +++ b/tests/auxiliary_files/test_generate_markdown_file/sb2nov_empty/None_CV.md @@ -0,0 +1,7 @@ +# None's CV + + + +# Test + +test diff --git a/tests/auxiliary_files/test_latex_to_pdf/classic_empty/John_Doe_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/classic_empty/John_Doe_CV.pdf deleted file mode 100644 index 75e552a..0000000 Binary files a/tests/auxiliary_files/test_latex_to_pdf/classic_empty/John_Doe_CV.pdf and /dev/null differ diff --git a/tests/auxiliary_files/test_latex_to_pdf/classic_empty/None_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/classic_empty/None_CV.pdf new file mode 100644 index 0000000..b7a3d8a Binary files /dev/null and b/tests/auxiliary_files/test_latex_to_pdf/classic_empty/None_CV.pdf differ diff --git a/tests/auxiliary_files/test_latex_to_pdf/classic_filled/John_Doe_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/classic_filled/John_Doe_CV.pdf index a5d2216..69d6cc4 100644 Binary files a/tests/auxiliary_files/test_latex_to_pdf/classic_filled/John_Doe_CV.pdf and b/tests/auxiliary_files/test_latex_to_pdf/classic_filled/John_Doe_CV.pdf differ diff --git a/tests/auxiliary_files/test_latex_to_pdf/moderncv_empty/John_Doe_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/moderncv_empty/John_Doe_CV.pdf deleted file mode 100644 index a355d91..0000000 Binary files a/tests/auxiliary_files/test_latex_to_pdf/moderncv_empty/John_Doe_CV.pdf and /dev/null differ diff --git a/tests/auxiliary_files/test_latex_to_pdf/moderncv_empty/None_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/moderncv_empty/None_CV.pdf new file mode 100644 index 0000000..0d168f4 Binary files /dev/null and b/tests/auxiliary_files/test_latex_to_pdf/moderncv_empty/None_CV.pdf differ diff --git a/tests/auxiliary_files/test_latex_to_pdf/moderncv_filled/John_Doe_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/moderncv_filled/John_Doe_CV.pdf index cacc919..2bd89c4 100644 Binary files a/tests/auxiliary_files/test_latex_to_pdf/moderncv_filled/John_Doe_CV.pdf and b/tests/auxiliary_files/test_latex_to_pdf/moderncv_filled/John_Doe_CV.pdf differ diff --git a/tests/auxiliary_files/test_latex_to_pdf/sb2nov_empty/John_Doe_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/sb2nov_empty/John_Doe_CV.pdf deleted file mode 100644 index 175d01e..0000000 Binary files a/tests/auxiliary_files/test_latex_to_pdf/sb2nov_empty/John_Doe_CV.pdf and /dev/null differ diff --git a/tests/auxiliary_files/test_latex_to_pdf/sb2nov_empty/None_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/sb2nov_empty/None_CV.pdf new file mode 100644 index 0000000..c331142 Binary files /dev/null and b/tests/auxiliary_files/test_latex_to_pdf/sb2nov_empty/None_CV.pdf differ diff --git a/tests/auxiliary_files/test_latex_to_pdf/sb2nov_filled/John_Doe_CV.pdf b/tests/auxiliary_files/test_latex_to_pdf/sb2nov_filled/John_Doe_CV.pdf index b1fc5d9..937fa8a 100644 Binary files a/tests/auxiliary_files/test_latex_to_pdf/sb2nov_filled/John_Doe_CV.pdf and b/tests/auxiliary_files/test_latex_to_pdf/sb2nov_filled/John_Doe_CV.pdf differ diff --git a/tests/auxiliary_files/test_markdown_to_html/classic_empty/John_Doe_CV_PASTETOGRAMMARLY.html b/tests/auxiliary_files/test_markdown_to_html/classic_empty/John_Doe_CV_PASTETOGRAMMARLY.html deleted file mode 100644 index 0814fe1..0000000 --- a/tests/auxiliary_files/test_markdown_to_html/classic_empty/John_Doe_CV_PASTETOGRAMMARLY.html +++ /dev/null @@ -1 +0,0 @@ -

John Doe's CV

\ No newline at end of file diff --git a/tests/auxiliary_files/test_markdown_to_html/classic_empty/None_CV_PASTETOGRAMMARLY.html b/tests/auxiliary_files/test_markdown_to_html/classic_empty/None_CV_PASTETOGRAMMARLY.html new file mode 100644 index 0000000..f966c13 --- /dev/null +++ b/tests/auxiliary_files/test_markdown_to_html/classic_empty/None_CV_PASTETOGRAMMARLY.html @@ -0,0 +1,3 @@ +

None's CV

+

Test

+

test

\ No newline at end of file diff --git a/tests/auxiliary_files/test_markdown_to_html/moderncv_empty/John_Doe_CV_PASTETOGRAMMARLY.html b/tests/auxiliary_files/test_markdown_to_html/moderncv_empty/John_Doe_CV_PASTETOGRAMMARLY.html deleted file mode 100644 index 0814fe1..0000000 --- a/tests/auxiliary_files/test_markdown_to_html/moderncv_empty/John_Doe_CV_PASTETOGRAMMARLY.html +++ /dev/null @@ -1 +0,0 @@ -

John Doe's CV

\ No newline at end of file diff --git a/tests/auxiliary_files/test_markdown_to_html/moderncv_empty/None_CV_PASTETOGRAMMARLY.html b/tests/auxiliary_files/test_markdown_to_html/moderncv_empty/None_CV_PASTETOGRAMMARLY.html new file mode 100644 index 0000000..f966c13 --- /dev/null +++ b/tests/auxiliary_files/test_markdown_to_html/moderncv_empty/None_CV_PASTETOGRAMMARLY.html @@ -0,0 +1,3 @@ +

None's CV

+

Test

+

test

\ No newline at end of file diff --git a/tests/auxiliary_files/test_markdown_to_html/sb2nov_empty/John_Doe_CV_PASTETOGRAMMARLY.html b/tests/auxiliary_files/test_markdown_to_html/sb2nov_empty/John_Doe_CV_PASTETOGRAMMARLY.html deleted file mode 100644 index 0814fe1..0000000 --- a/tests/auxiliary_files/test_markdown_to_html/sb2nov_empty/John_Doe_CV_PASTETOGRAMMARLY.html +++ /dev/null @@ -1 +0,0 @@ -

John Doe's CV

\ No newline at end of file diff --git a/tests/auxiliary_files/test_markdown_to_html/sb2nov_empty/None_CV_PASTETOGRAMMARLY.html b/tests/auxiliary_files/test_markdown_to_html/sb2nov_empty/None_CV_PASTETOGRAMMARLY.html new file mode 100644 index 0000000..f966c13 --- /dev/null +++ b/tests/auxiliary_files/test_markdown_to_html/sb2nov_empty/None_CV_PASTETOGRAMMARLY.html @@ -0,0 +1,3 @@ +

None's CV

+

Test

+

test

\ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index 54b3ce4..e9fa46a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -61,7 +61,7 @@ def rendercv_data_model() -> dm.RenderCVDataModel: @pytest.fixture def rendercv_empty_curriculum_vitae_data_model() -> dm.CurriculumVitae: - return dm.CurriculumVitae() + return dm.CurriculumVitae(sections={"test": ["test"]}) @pytest.fixture diff --git a/tests/test_renderer.py b/tests/test_renderer.py index 015d9d5..359bbb5 100644 --- a/tests/test_renderer.py +++ b/tests/test_renderer.py @@ -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}": None}, "Hello, World!"), + ("Hello, {name}!", {"{name}": None}, "Hello, None!"), ( "{greeting}, {name}!", {"{greeting}": "Hello", "{name}": "World"}, @@ -299,12 +299,14 @@ def test_generate_latex_file( / f"{theme_name}_{folder_name_dictionary[curriculum_vitae_data_model]}" ) - file_name = "John_Doe_CV.tex" + cv_data_model = request.getfixturevalue(curriculum_vitae_data_model) + + file_name = f"{str(cv_data_model.name).replace(' ', '_')}_CV.tex" output_file_path = tmp_path / "make_sure_it_generates_the_directory" / file_name reference_file_path = reference_directory_path / file_name data_model = dm.RenderCVDataModel( - cv=request.getfixturevalue(curriculum_vitae_data_model), + cv=cv_data_model, design={"theme": theme_name}, ) r.generate_latex_file(data_model, tmp_path / "make_sure_it_generates_the_directory") @@ -340,12 +342,14 @@ def test_generate_markdown_file( / f"{theme_name}_{folder_name_dictionary[curriculum_vitae_data_model]}" ) - file_name = "John_Doe_CV.md" + cv_data_model = request.getfixturevalue(curriculum_vitae_data_model) + + file_name = f"{str(cv_data_model.name).replace(' ', '_')}_CV.md" output_file_path = tmp_path / "make_sure_it_generates_the_directory" / file_name reference_file_path = reference_directory_path / file_name data_model = dm.RenderCVDataModel( - cv=request.getfixturevalue(curriculum_vitae_data_model), + cv=cv_data_model, ) r.generate_markdown_file( data_model, tmp_path / "make_sure_it_generates_the_directory" @@ -486,7 +490,11 @@ def test_generate_latex_file_and_copy_theme_files( ) @time_machine.travel("2024-01-01") def test_latex_to_pdf( - tmp_path, auxiliary_files_directory_path, theme_name, curriculum_vitae_data_model + tmp_path, + request, + auxiliary_files_directory_path, + theme_name, + curriculum_vitae_data_model, ): latex_sources_path = ( auxiliary_files_directory_path @@ -499,6 +507,9 @@ def test_latex_to_pdf( / f"{theme_name}_{folder_name_dictionary[curriculum_vitae_data_model]}" ) + cv_data_model = request.getfixturevalue(curriculum_vitae_data_model) + file_name_stem = f"{str(cv_data_model.name).replace(' ', '_')}_CV" + # Update the auxiliary files if update_auxiliary_files is True if update_auxiliary_files: # copy the latex sources to the reference_directory_path @@ -508,7 +519,7 @@ def test_latex_to_pdf( # convert the latex code to a pdf reference_pdf_file_path = r.latex_to_pdf( - reference_directory_path / "John_Doe_CV.tex" + reference_directory_path / f"{file_name_stem}.tex" ) # remove the latex sources from the reference_directory_path, but keep the pdf @@ -520,8 +531,8 @@ def test_latex_to_pdf( shutil.copytree(latex_sources_path, tmp_path, dirs_exist_ok=True) # convert the latex code to a pdf - reference_pdf_file_path = reference_directory_path / "John_Doe_CV.pdf" - output_file_path = r.latex_to_pdf(tmp_path / "John_Doe_CV.tex") + reference_pdf_file_path = reference_directory_path / f"{file_name_stem}.pdf" + output_file_path = r.latex_to_pdf(tmp_path / f"{file_name_stem}.tex") text1 = pypdf.PdfReader(output_file_path).pages[0].extract_text() text2 = pypdf.PdfReader(reference_pdf_file_path).pages[0].extract_text() @@ -547,7 +558,11 @@ def test_latex_to_pdf_invalid_latex_file(): ) @time_machine.travel("2024-01-01") def test_markdown_to_html( - tmp_path, auxiliary_files_directory_path, theme_name, curriculum_vitae_data_model + tmp_path, + request, + auxiliary_files_directory_path, + theme_name, + curriculum_vitae_data_model, ): markdown_sources_path = ( auxiliary_files_directory_path @@ -560,13 +575,16 @@ def test_markdown_to_html( / f"{theme_name}_{folder_name_dictionary[curriculum_vitae_data_model]}" ) + cv_data_model = request.getfixturevalue(curriculum_vitae_data_model) + file_name_stem = f"{str(cv_data_model.name).replace(' ', '_')}_CV" + # Update the auxiliary files if update_auxiliary_files is True if update_auxiliary_files: # copy the markdown sources to the reference_directory shutil.copytree(markdown_sources_path, reference_directory, dirs_exist_ok=True) # convert markdown to html - r.markdown_to_html(reference_directory / "John_Doe_CV.md") + r.markdown_to_html(reference_directory / f"{file_name_stem}.md") # remove the markdown sources from the reference_directory for file in reference_directory.iterdir(): @@ -577,8 +595,10 @@ def test_markdown_to_html( shutil.copytree(markdown_sources_path, tmp_path, dirs_exist_ok=True) # convert markdown to html - output_file_path = r.markdown_to_html(tmp_path / "John_Doe_CV.md") - reference_file_path = reference_directory / "John_Doe_CV_PASTETOGRAMMARLY.html" + output_file_path = r.markdown_to_html(tmp_path / f"{file_name_stem}.md") + reference_file_path = ( + reference_directory / f"{file_name_stem}_PASTETOGRAMMARLY.html" + ) assert filecmp.cmp(output_file_path, reference_file_path)