AICertification/app/flask-postgres/tests/test_app_smoke.py
2026-04-02 16:49:06 +02:00

27 lines
606 B
Python

import pytest
import os
os.environ["DB_HOST"] = "192.168.0.10"
os.environ["DB_NAME"] = "CertDB"
os.environ["DB_USER"] = "CertUser"
os.environ["DB_PASSWORD"] = "CertPWD"
os.environ["DB_PORT"] = "55432"
os.environ["LOG_DIR"] = "./logs"
from app.app import app
@pytest.fixture
def client():
app.config["TESTING"] = True
with app.test_client() as client:
yield client
def test_app_exists():
assert app is not None
def test_protected_videos_requires_login(client):
response = client.get("/videos/A1.mp4", follow_redirects=False)
assert response.status_code in (302, 401, 403)