improve run_latex test

This commit is contained in:
Sina Atalay 2023-10-09 21:07:48 +02:00
parent 178b4616c1
commit 71e05ad26a
7 changed files with 5 additions and 7 deletions

View File

@ -338,7 +338,7 @@ def render_template(data: RenderCVDataModel, output_path: str = None) -> str:
end_time = time.time()
time_taken = end_time - start_time
logger.info(f"Rendering the LaTeX file has finished in {time_taken:.2f} s.")
logger.info(f"Rendering the LaTeX file ({output_file_path}) has finished in {time_taken:.2f} s.")
return output_file_path
@ -395,9 +395,7 @@ def run_latex(latex_file_path):
end_time = time.time()
time_taken = end_time - start_time
logger.info(
f"Running TinyTeX to generate the PDF has finished in {time_taken:.2f} s."
f"Running TinyTeX to generate the PDF ({output_file_path}) has finished in {time_taken:.2f} s."
)
return os.path.join(
os.path.dirname(latex_file_path), latex_file.replace(".tex", ".pdf")
)
return output_file_path

View File

@ -101,7 +101,7 @@
\LenToUnit{\paperwidth-1.35 cm},
\LenToUnit{\paperheight-0.675 cm}
){\vtop{{\null}\makebox[0pt][c]{
\small\color{gray}\emph{Last updated on REPLACE_THIS_WITH_TODAY} \hspace{\widthof{Last updated on REPLACE_THIS_WITH_TODAY}}
\small\color{gray}\emph{Last updated on REPLACETHISWITHTODAY} \hspace{\widthof{Last updated on REPLACETHISWITHTODAY}}
}}}%
}%
}%

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -377,7 +377,7 @@ class TestDataModel(unittest.TestCase):
with open(reference_file_path, "r") as file:
reference = file.read()
reference = reference.replace(
"REPLACE_THIS_WITH_TODAY", rendering.get_today()
"REPLACETHISWITHTODAY", rendering.get_today()
)
self.assertEqual(output, reference)