Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
marians committed Nov 14, 2023
1 parent 1d4cb5e commit b07f0ce
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
pkg-manager: pip
- run:
name: Run Python unit tests
command: python3 hugo_test.py
command:
python3 common_test.py
python3 hugo_test.py

workflows:
publish:
Expand Down
31 changes: 31 additions & 0 deletions common_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import unittest
from common import html2text

html = """
<html>
<head/>
<body>
<div>This is my body</div>
</body>
</html>
"""

text = """
This is my body
"""



class TestHTML2Text(unittest.TestCase):

def test1(self):
mytext = html2text(html)
self.assertEqual(text, mytext)

if __name__ == '__main__':
unittest.main()

0 comments on commit b07f0ce

Please sign in to comment.