Init Repo
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test script to check if the recovery API endpoints are working correctly.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
from database import SessionLocal
|
||||
from services.recovery_service import RecoveryService
|
||||
|
||||
def test_recovery_service():
|
||||
"""Test the recovery service directly."""
|
||||
db: Session = SessionLocal()
|
||||
try:
|
||||
recovery_service = RecoveryService()
|
||||
|
||||
# Test getting deleted shots
|
||||
print("Testing get_deleted_shots...")
|
||||
deleted_shots = recovery_service.get_deleted_shots(None, db)
|
||||
print(f"Found {len(deleted_shots)} deleted shots:")
|
||||
|
||||
for shot in deleted_shots:
|
||||
print(f" - ID: {shot.id}, Name: {shot.name}, Project: {shot.project_name}")
|
||||
print(f" Episode: {shot.episode_name}, Deleted: {shot.deleted_at}")
|
||||
print(f" Tasks: {shot.task_count}, Submissions: {shot.submission_count}")
|
||||
print()
|
||||
|
||||
# Test getting deleted assets
|
||||
print("Testing get_deleted_assets...")
|
||||
deleted_assets = recovery_service.get_deleted_assets(None, db)
|
||||
print(f"Found {len(deleted_assets)} deleted assets:")
|
||||
|
||||
for asset in deleted_assets:
|
||||
print(f" - ID: {asset.id}, Name: {asset.name}, Project: {asset.project_name}")
|
||||
print(f" Category: {asset.category}, Deleted: {asset.deleted_at}")
|
||||
print(f" Tasks: {asset.task_count}, Submissions: {asset.submission_count}")
|
||||
print()
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_recovery_service()
|
||||
Reference in New Issue
Block a user