initial creation

This commit is contained in:
2025-05-20 11:57:43 -04:00
commit c98b612926
8447 changed files with 1862526 additions and 0 deletions
@@ -0,0 +1,37 @@
import pytest
from snakeeyes.app import create_app
@pytest.yield_fixture(scope='session')
def app():
"""
Setup our flask test app, this only gets executed once.
:return: Flask app
"""
params = {
'DEBUG': False,
'TESTING': True,
}
_app = create_app(settings_override=params)
# Establish an application context before running the tests.
ctx = _app.app_context()
ctx.push()
yield _app
ctx.pop()
@pytest.yield_fixture(scope='function')
def client(app):
"""
Setup an app client, this gets executed for each test function.
:param app: Pytest fixture
:return: Flask app client
"""
yield app.test_client()
@@ -0,0 +1,18 @@
from flask import url_for
class TestPage(object):
def test_home_page(self, client):
""" Home page should respond with a success 200. """
response = client.get(url_for('page.home'))
assert response.status_code == 200
def test_terms_page(self, client):
""" Terms page should respond with a success 200. """
response = client.get(url_for('page.terms'))
assert response.status_code == 200
def test_privacy_page(self, client):
""" Privacy page should respond with a success 200. """
response = client.get(url_for('page.privacy'))
assert response.status_code == 200