#!/usr/bin/env python3 """ Simple test to verify basic functionality """ import os import sqlite3 from pathlib import Path def test_sqlite_connection(): """Test basic SQLite connection""" print("šŸ—„ļø Testing SQLite database...") db_path = "fishbowl_test.db" try: # Create a simple test table conn = sqlite3.connect(db_path) cursor = conn.cursor() cursor.execute(""" CREATE TABLE IF NOT EXISTS test_table ( id INTEGER PRIMARY KEY, name TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) """) cursor.execute("INSERT INTO test_table (name) VALUES (?)", ("test_entry",)) conn.commit() cursor.execute("SELECT * FROM test_table") results = cursor.fetchall() conn.close() print(f"āœ… SQLite working: {len(results)} entries in test table") return True except Exception as e: print(f"āŒ SQLite error: {e}") return False def test_directories(): """Test directory structure""" print("šŸ“ Testing directory structure...") required_dirs = [ "config", "data/vector_stores", "logs", "src", "migrations" ] all_good = True for dir_path in required_dirs: if Path(dir_path).exists(): print(f"āœ… {dir_path}") else: print(f"āŒ Missing: {dir_path}") all_good = False return all_good def test_config_files(): """Test configuration files""" print("āš™ļø Testing configuration files...") required_files = [ "config/fishbowl_config.json", ".env", "requirements.txt" ] all_good = True for file_path in required_files: if Path(file_path).exists(): print(f"āœ… {file_path}") else: print(f"āŒ Missing: {file_path}") all_good = False return all_good def test_python_imports(): """Test key Python imports""" print("šŸ Testing Python dependencies...") try: import sqlalchemy print(f"āœ… SQLAlchemy {sqlalchemy.__version__}") import aiosqlite print("āœ… aiosqlite") import pydantic print(f"āœ… Pydantic {pydantic.__version__}") import httpx print(f"āœ… httpx {httpx.__version__}") return True except ImportError as e: print(f"āŒ Import error: {e}") return False def main(): print("🐠 Discord Fishbowl Simple Setup Test") print("=" * 50) tests = [ ("Directory Structure", test_directories), ("Config Files", test_config_files), ("Python Dependencies", test_python_imports), ("SQLite Database", test_sqlite_connection), ] all_passed = True for test_name, test_func in tests: print(f"\nšŸ”§ {test_name}") print("-" * (len(test_name) + 3)) if not test_func(): all_passed = False print("\n" + "=" * 50) if all_passed: print("šŸŽ‰ All basic tests passed!") print("\nNext steps:") print("1. Install Ollama: https://ollama.ai/") print("2. Pull a model: ollama pull llama2") print("3. Test the full system (requires Discord setup)") print("4. Run creative collaboration demo: python scripts/demo_creative_integration.py") else: print("šŸ’„ Some tests failed - setup needs attention") return all_passed if __name__ == "__main__": success = main() exit(0 if success else 1)