This commit is contained in:
@ -3,6 +3,7 @@
|
||||
"""PyTest unit tests."""
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
from app.app import app, csrf
|
||||
|
@ -3,10 +3,10 @@
|
||||
"""Tests for app/app.py"""
|
||||
|
||||
|
||||
from tests import client # pragma: no cover
|
||||
from tests import client # pragma: no cover
|
||||
|
||||
|
||||
def test_index(client) -> None:
|
||||
"""Ensure that the index page is loaded correctly."""
|
||||
req = client.get('/')
|
||||
req = client.get("/")
|
||||
assert req.status_code == 200 and "ePage" in req.text
|
||||
|
@ -7,9 +7,5 @@ from app.send_page import send_page
|
||||
|
||||
def test_send_page_no_env() -> None:
|
||||
"""Ensure the API returns an error if no API key specified."""
|
||||
result = send_page(
|
||||
name='Unit Test',
|
||||
email='none@none.com',
|
||||
message='Unit Test'
|
||||
)
|
||||
assert not result[0] and result[1].get('token') == 'invalid'
|
||||
result = send_page(name="Unit Test", email="none@none.com", message="Unit Test")
|
||||
assert not result[0] and result[1].get("token") == "invalid"
|
||||
|
Reference in New Issue
Block a user