40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
|
|
import sys
|
|
import os
|
|
|
|
# Ensure we can import app
|
|
sys.path.append(os.getcwd())
|
|
|
|
print("Importing app modules...")
|
|
try:
|
|
from app import models, schemas, auth, main
|
|
print("Imports successful.")
|
|
except Exception as e:
|
|
print(f"Import failed: {e}")
|
|
sys.exit(1)
|
|
|
|
print("Testing Key Generation...")
|
|
try:
|
|
priv, pub = auth.generate_key_pair()
|
|
if priv and pub:
|
|
print("Key generation successful.")
|
|
print(f"Public Key sample: {pub[:30]}...")
|
|
else:
|
|
print("Key generation returned empty values.")
|
|
sys.exit(1)
|
|
except Exception as e:
|
|
print(f"Key generation failed: {e}")
|
|
sys.exit(1)
|
|
|
|
print("Testing Model Instantiation...")
|
|
try:
|
|
user = models.User(username="test", public_key=pub, private_key=priv)
|
|
heir = models.Heir(name="heir1")
|
|
asset = models.Asset(title="test asset", content="content", private_key_shard="shard")
|
|
print("Model instantiation successful.")
|
|
except Exception as e:
|
|
print(f"Model instantiation failed: {e}")
|
|
sys.exit(1)
|
|
|
|
print("Verification passed!")
|