الملفات
Complete-CI-CD-Project-pipe…/test_app.py
ahmedgamalyousef 295e7cb9c6
فشلت بعض الفحوصات
CI/CD Pipeline - Weather App 🌤️ / test (push) Successful in 40s
CI/CD Pipeline - Weather App 🌤️ / deploy (push) Has been cancelled
CI/CD Pipeline - Weather App 🌤️ / build_and_push_image (push) Has been cancelled
Add basic unit tests for Flask app
2025-10-14 20:02:42 +03:00

22 أسطر
555 B
Python

import pytest
from app import app
# ✅ Basic test to ensure the Flask app starts successfully
@pytest.fixture
def client():
app.testing = True
with app.test_client() as client:
yield client
def test_home_route(client):
"""Test that the home route returns 200 OK"""
response = client.get('/')
assert response.status_code == 200
def test_weather_page_content(client):
"""Check if page contains expected content"""
response = client.get('/')
assert b"Weather" in response.data or b"temperature" in response.data