From 05f24f4d34f2f305e06db4ec0f83f2d596ddce8b Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Sun, 19 Nov 2023 20:29:52 +0100 Subject: [PATCH] fix tests --- .../John_Doe_CV_tex_reference.tex | 52 ++++++++----------- tests/test_data_model.py | 2 +- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/tests/reference_files/John_Doe_CV_tex_reference.tex b/tests/reference_files/John_Doe_CV_tex_reference.tex index bc5e318..6d74e01 100644 --- a/tests/reference_files/John_Doe_CV_tex_reference.tex +++ b/tests/reference_files/John_Doe_CV_tex_reference.tex @@ -91,7 +91,7 @@ parsep=0.07 cm, partopsep=0pt, itemsep=0pt, - after=\vspace*{-1\baselineskip}, + after=\vspace{-1\baselineskip}, leftmargin=0.6 cm + 3pt ] }{ @@ -110,7 +110,7 @@ \LenToUnit{\paperwidth-1.35 cm-0.2 cm+0.05cm}, \LenToUnit{\paperheight-0.675 cm} ){\vtop{{\null}\makebox[0pt][c]{ - \small\color{gray}\textit{Last updated on November 18, 2023}\hspace{\widthof{Last updated on November 18, 2023}} + \small\color{gray}\textit{Last updated on November 19, 2023}\hspace{\widthof{Last updated on November 19, 2023}} }}}% }% }% @@ -158,7 +158,7 @@ \textbf{BS} & \textbf{My University}, Mechanical Engineering - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item GPA: 3.99/4.00 (\href{https://example.com/}{Transcript}) \item Class rank: 1 of 62 \hspace*{-0.2cm} @@ -168,13 +168,12 @@ Sept. 2017 to Jan. 2023 \end{tabularx} - \vspace*{0.12 cm} - + \vspace{0.12 cm} \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{L{0.85cm} K{0.2 cm} R{3.6 cm}} \textbf{} & \textbf{The University of Texas at Austin}, Mechanical Engineering, Student Exchange Program - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item GPA: 4.00/4.00 (\href{https://example.com/}{Transcript}) \hspace*{-0.2cm} \end{highlights} @@ -189,7 +188,7 @@ \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm} R{3.6 cm}} \textbf{CERN}, Mechanical Engineer - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item CERN is a research organization that operates the world's largest and most powerful particle accelerator. \item Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. @@ -201,11 +200,10 @@ 10 months \end{tabularx} - \vspace*{0.12 cm} - + \vspace{0.12 cm} \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm} R{3.6 cm}} \textbf{AmIACompany}, Summer Intern - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item AmIACompany is a technology company that provides web-based engineering applications that enable the simulation and optimization of products and manufacturing tools. \item Modeled and simulated a metal-forming process deep drawing using finite element analysis with open-source software called CalculiX. \hspace*{-0.2cm} @@ -222,7 +220,7 @@ \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm} R{3.6 cm}} \textbf{Design and Construction of a Robot}, \href{https://example.com/}{view on my website} - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item Designed and constructed a controllable robot that measures a car's torque and power output at different speeds for my senior design project. \hspace*{-0.2cm} \end{highlights} @@ -231,11 +229,10 @@ Fall 2022 \end{tabularx} - \vspace*{0.12 cm} - + \vspace{0.12 cm} \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm} R{3.6 cm}} \textbf{Design and Construction of an Another Robot}, \href{https://example.com/}{view on my website} - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item Designed, built, and programmed a microcontroller-based device that plays a guitar with DC motors as part of a mechatronics course term project. \hspace*{-0.2cm} \end{highlights} @@ -250,7 +247,7 @@ \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm} R{3.6 cm}} \textbf{Machine Learning by Stanford University}, \href{https://example.com/}{Certificate} - \vspace*{0.12 cm} + \vspace{0.12 cm} & Sept. 2022 \end{tabularx} @@ -261,7 +258,7 @@ \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm} R{3.6 cm}} \textbf{Ray Tracing in C++}, \href{https://example.com/}{view on my website} - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item Coded a ray tracer in C++ that can render scenes with multiple light sources, spheres, and planes with reflection and refraction properties. \hspace*{-0.2cm} \end{highlights} @@ -282,8 +279,7 @@ \par\endgroup - \vspace*{0.12 cm} - + \vspace{0.12 cm} \begingroup\raggedright \leftskip=0.2 cm \advance\csname @rightskip\endcsname 0.2 cm @@ -293,8 +289,7 @@ \par\endgroup - \vspace*{0.12 cm} - + \vspace{0.12 cm} \begingroup\raggedright \leftskip=0.2 cm \advance\csname @rightskip\endcsname 0.2 cm @@ -304,8 +299,7 @@ \par\endgroup - \vspace*{0.12 cm} - + \vspace{0.12 cm} \begingroup\raggedright \leftskip=0.2 cm \advance\csname @rightskip\endcsname 0.2 cm @@ -328,8 +322,7 @@ \par\endgroup - \vspace*{0.12 cm} - + \vspace{0.12 cm} \begingroup\raggedright \leftskip=0.2 cm \advance\csname @rightskip\endcsname 0.2 cm @@ -345,7 +338,7 @@ \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm} R{3.6 cm}} \textbf{Dumanlikiz Skiing Club}, Co-founder / Skiing Instructor - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item Taught skiing during winters as a certified skiing instructor. \hspace*{-0.2cm} \end{highlights} @@ -386,8 +379,7 @@ \par\endgroup - \vspace*{0.12 cm} - + \vspace{0.12 cm} \begingroup\raggedright \leftskip=0.2 cm \advance\csname @rightskip\endcsname 0.2 cm @@ -405,7 +397,7 @@ \textbf{HA} & \textbf{Hop!}, Hop! - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item There are only five types of entries: \textit{EducationEntry}, \textit{ExperienceEntry}, \textit{NormalEntry}, \textit{OneLineEntry}, and \textit{PublicationEntry}. \item This is an EducationEntry! \hspace*{-0.2cm} @@ -421,7 +413,7 @@ \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm} R{3.6 cm}} \textbf{Hop!}, Hop! - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item I think this is really working. This is an \textit{ExperienceEntry}! \hspace*{-0.2cm} \end{highlights} @@ -436,7 +428,7 @@ \begin{tabularx}{\textwidth-0.4 cm-0.13cm}{K{0.2 cm}} \textbf{This is a normal entry!}, \href{https://example.com/}{My Link Text} - \vspace*{0.12 cm} + \vspace{0.12 cm} \begin{highlights} \item You don't have to specify a \textit{date} or \textbf{location} every time. \item You can use \textit{Markdown} in the \textbf{highlights}! diff --git a/tests/test_data_model.py b/tests/test_data_model.py index 02f3ca5..42e90a3 100644 --- a/tests/test_data_model.py +++ b/tests/test_data_model.py @@ -17,7 +17,7 @@ class TestDataModel(unittest.TestCase): self.assertEqual(result, expected) str_with_latex_characers = r"asdf#asdf$asdf%asdf& ~ fd_ \ ^aa aa{ bb}" - expected ='asdf\\#asdf$asdf\\%asdf\\& \\textasciitilde{} fd_ \\ ^aa aa\\{ bb\\}' + expected ='asdf\\#asdf$asdf\\%asdf\\& \\textasciitilde{} fd_ \\ ^aa aa{ bb}' with self.subTest(msg="string with LaTeX characters"): result = data_model.escape_latex_characters(str_with_latex_characers) print(result)