31 lines
866 B
Python
31 lines
866 B
Python
"""Quick test of core functionality"""
|
|
import sys
|
|
sys.path.append('backend')
|
|
|
|
print("🧪 Quick System Test")
|
|
|
|
# Test 1: News Fetching
|
|
print("1. Testing news fetching...")
|
|
from news_fetcher import NewsFetcher
|
|
fetcher = NewsFetcher()
|
|
articles = fetcher.fetch_rss_feed("https://feeds.bbci.co.uk/news/rss.xml")
|
|
print(f"✅ Fetched {len(articles)} articles")
|
|
|
|
# Test 2: Basic imports
|
|
print("2. Testing imports...")
|
|
from embeddings import EmbeddingGenerator
|
|
from vector_store import VectorStore
|
|
from recommender import NewsRecommender
|
|
print("✅ All modules imported")
|
|
|
|
# Test 3: FastAPI server
|
|
print("3. Testing FastAPI...")
|
|
import requests
|
|
try:
|
|
response = requests.get("http://localhost:8000/", timeout=3)
|
|
print(f"✅ FastAPI server: {response.json()['message']}")
|
|
except:
|
|
print("⚠️ FastAPI server not running")
|
|
|
|
print("🎉 Core system operational!")
|