Add file test

This commit is contained in:
flyingscorpio@arch-desktop 2021-06-11 12:11:58 +02:00
parent 6bf66a71eb
commit 04787fd1d1
4 changed files with 43 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
*.swp
__pycache__
*.html
!test_*.html

11
src/tests/test_file.html Normal file
View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>Test main</title>
</head>
<body>
body
</body>
</html>

24
src/tests/test_file.py Normal file
View file

@ -0,0 +1,24 @@
"""File Test Case"""
import unittest
from src import flytex2html
class TestFile(unittest.TestCase):
"""File Test Case"""
@unittest.skip(reason="Not yet implemented")
def test_file(self) -> None:
"""Entire LaTeX file"""
with open("./src/tests/test_file.tex", "r") as latex_file:
latex = latex_file.read()
with open("./src/tests/test_file.html", "r") as html_file:
html = html_file.read()
self.assertEqual(flytex2html.process_content(latex), html)
if __name__ == "__main__":
unittest.main()

7
src/tests/test_file.tex Normal file
View file

@ -0,0 +1,7 @@
\documentclass{article}
\begin{document}
Test main
\end{document}