Spaces:
Running
Running
| import sys | |
| from pathlib import Path | |
| # Add src to path | |
| sys.path.append(str(Path(__file__).parent)) | |
| from src.db.firebase import verify_token | |
| import firebase_admin | |
| def test_verify(): | |
| print("Testing verify_token with invalid token...") | |
| # This should return a dict with error and no payload | |
| result = verify_token("invalid_token") | |
| print(f"Result type: {type(result)}") | |
| print(f"Result content: {result}") | |
| if isinstance(result, dict): | |
| payload = result.get("payload") | |
| error = result.get("error") | |
| print(f"Payload: {payload} (Type: {type(payload)})") | |
| print(f"Error: {error} (Type: {type(error)})") | |
| if not payload: | |
| print("Payload is falsy") | |
| if not error: | |
| print("Error is falsy") | |
| if __name__ == "__main__": | |
| test_verify() | |