Fix lint errors
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""PyTest unit tests."""
|
||||
|
||||
import pytest
|
||||
|
||||
from app.app import app
|
||||
@ -7,5 +9,6 @@ from app.app import app
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
"""Set up Flask client for use in tests."""
|
||||
client = app.test_client()
|
||||
yield client
|
||||
|
@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import pytest
|
||||
"""Tests for app/app.py"""
|
||||
|
||||
|
||||
from tests import client
|
||||
|
||||
|
||||
def test_index(client) -> None:
|
||||
"""Ensure that the index page is loaded correctly."""
|
||||
req = client.get('/')
|
||||
assert req.status_code == 200 and "ePage" in req.text
|
||||
|
@ -1,12 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""Tests for app/send_page.py"""
|
||||
|
||||
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 result[0] == False and result[1].get('token') == 'invalid'
|
||||
assert not result[0] and result[1].get('token') == 'invalid'
|
||||
|
Reference in New Issue
Block a user