Initial
This commit is contained in:
11
tests/__init__.py
Normal file
11
tests/__init__.py
Normal 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
10
tests/test_app.py
Normal 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
|
12
tests/test_send_page.py
Normal file
12
tests/test_send_page.py
Normal 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'
|
Reference in New Issue
Block a user