Squash everything befor release.

Some past commits might have contained Cursor's IP or accidentally
commited API keys. Before making the repository public, all the history
has been squashed into a single commit with.
This commit is contained in:
gabrii
2025-09-14 17:38:55 +02:00
commit 8a87d0033b
40 changed files with 2204 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
"""Tests for the app."""
+27
View File
@@ -0,0 +1,27 @@
"""Defines fixtures available to all tests."""
import logging
import pytest
from webtest import TestApp
from app import create_app
@pytest.fixture
def app():
"""Create application for the tests."""
_app = create_app("tests.settings")
_app.logger.setLevel(logging.CRITICAL)
ctx = _app.test_request_context()
ctx.push()
yield _app
ctx.pop()
@pytest.fixture
def testapp(app):
"""Create Webtest app."""
return TestApp(app)
+1
View File
@@ -0,0 +1 @@
"""Factories to help in tests."""
+20
View File
@@ -0,0 +1,20 @@
"""Settings module for test app."""
ENV = "development"
TESTING = True
SERVICE_API_KEY = "test-service-api-key"
AZURE_API_VERSION = "2025-04-01-preview"
AZURE_BASE_URL = "test-base-url"
AZURE_API_KEY = "test-api-key"
AZURE_DEPLOYMENT = "gpt-5"
AZURE_SUMMARY_LEVEL = "detailed"
AZURE_TRUNCATION = "auto"
RECORD_TRAFFIC = False
AZURE_RESPONSES_API_URL = (
f"{AZURE_BASE_URL}/openai/responses?api-version={AZURE_API_VERSION}"
)
+26
View File
@@ -0,0 +1,26 @@
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
class TestConfig:
"""Config."""
def test_config_is_set(self, testapp):
"""Ensure required config values are set."""
app = testapp.app
assert app.config["AZURE_BASE_URL"] != "change_me"
assert app.config["AZURE_API_KEY"] != "change_me"
class TestModels:
"""Models."""
def test_models_endpoint_returns_200(self, testapp):
"""Ensure /models endpoint returns HTTP 200."""
testapp.get("/models", status=401)
def test_health_endpoint_returns_200(self, testapp):
"""Ensure /health endpoint returns HTTP 200."""
testapp.get("/health", status=200)