46 lines
No EOL
1.3 KiB
Python
46 lines
No EOL
1.3 KiB
Python
"""
|
|
Manual test script for the webhook integration.
|
|
This script simulates a webhook call without processing a video,
|
|
allowing us to verify the webhook is working correctly.
|
|
"""
|
|
|
|
import logging
|
|
import sys
|
|
from video_processor import VideoProcessor
|
|
|
|
# Configure logging
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
|
handlers=[
|
|
logging.StreamHandler(sys.stdout)
|
|
]
|
|
)
|
|
logger = logging.getLogger('webhook_test')
|
|
|
|
def test_webhook_manually():
|
|
"""Test the webhook call manually"""
|
|
# Create a VideoProcessor instance
|
|
try:
|
|
processor = VideoProcessor()
|
|
logger.info("VideoProcessor initialized")
|
|
|
|
# Test user email
|
|
test_email = "test.user@example.com"
|
|
|
|
# Test prompt
|
|
test_prompt = "Test prompt for webhook verification"
|
|
|
|
# Call the webhook method directly
|
|
logger.info(f"Sending test webhook call for user {test_email}")
|
|
processor.send_usage_webhook(test_email, test_prompt)
|
|
|
|
logger.info("Webhook test completed")
|
|
|
|
except Exception as e:
|
|
logger.error(f"Error in webhook test: {str(e)}")
|
|
import traceback
|
|
logger.error(traceback.format_exc())
|
|
|
|
if __name__ == "__main__":
|
|
test_webhook_manually() |