18 lines
420 B
Python
18 lines
420 B
Python
import time
|
|
|
|
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
|
|
|
|
from deltatrace.audit_log import AuditLog
|
|
|
|
|
|
def test_audit_log_chain_and_verify():
|
|
key = Ed25519PrivateKey.generate()
|
|
a = AuditLog(key)
|
|
|
|
e1 = a.append("evt-1", "action-1", {"k": "v"})
|
|
time.sleep(0.00001)
|
|
e2 = a.append("evt-2", "action-2", {"k": "v2"})
|
|
|
|
assert len(a.entries) == 2
|
|
assert a.verify()
|