This commit is contained in:
2022-07-10 19:52:15 +01:00
parent dc7bc829b9
commit 97e6c49201
11 changed files with 174 additions and 3 deletions

11
tests/__init__.py Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import pytest
from app.app import app
@pytest.fixture
def client():
client = app.test_client()
yield client

10
tests/test_app.py Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python3
import pytest
from tests import client
def test_index(client) -> None:
req = client.get('/')
assert req.status_code == 200 and "ePage" in req.text

View File

12
tests/test_send_page.py Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
from app.send_page import send_page
def test_send_page_no_env() -> None:
result = send_page(
name='Unit Test',
email='none@none.com',
message='Unit Test'
)
assert result[0] == False and result[1].get('token') == 'invalid'