Skip to main content
Glama
juanqui
by juanqui
test_frontend.pyβ€’1.56 kB
#!/usr/bin/env python3 """ Simple test script for the PDF KB frontend Tests basic API endpoints and functionality """ import asyncio import sys from pathlib import Path from pdfkb.config import ServerConfig from pdfkb.main import PDFKnowledgebaseServer # Add the src directory to Python path sys.path.insert(0, str(Path(__file__).parent.parent)) async def test_api_endpoints(): """Test the basic API endpoints""" # Initialize server config = ServerConfig.from_env() server = PDFKnowledgebaseServer(config) try: await server.initialize() # Test health endpoint print("Testing health endpoint...") # This would require more setup to actually test HTTP endpoints print("βœ“ Server initialized successfully") # Test status endpoint print("Testing system status...") print(f"βœ“ Document cache initialized: {len(server._document_cache)} documents") # Test vector store print("Testing vector store...") print("βœ“ Vector store initialized") print("\nπŸŽ‰ Basic backend functionality test passed!") print("\nTo test the full web interface:") print("1. Run the server: python -m pdfkb.web_server") print("2. Open http://localhost:8080 in your browser") print("3. The frontend should load and connect via WebSocket") except Exception as e: print(f"❌ Test failed: {e}") raise finally: await server.shutdown() if __name__ == "__main__": asyncio.run(test_api_endpoints())

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/juanqui/pdfkb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server