Skip to content

Commit

Permalink
Pass 80% coverage requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeSchapp committed Oct 1, 2022
1 parent 17c26a4 commit 2792d61
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/resources/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
{{ test }}
</body>
</html>
24 changes: 24 additions & 0 deletions tests/test_webpage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from unittest.mock import patch
from lib.webpage import load_webpage, default_route
import os


def test_load_webpage():
webpage = load_webpage(f"{os.getcwd()}/tests/resources/test.html")
assert webpage == """<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
{{ test }}
</body>
</html>"""

@patch("lib.webpage.template.render_template")
@patch("lib.webpage.load_webpage")
def test_default_route(mock_webpage, render_template):
webpage = default_route()
mock_webpage.assert_called_with('webpages/default.html')


0 comments on commit 2792d61

Please sign in to comment.