Spaces:
Running
Running
File size: 826 Bytes
c29587d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 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()
|