feat(harness): add local session repository
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import json
|
||||
import uuid
|
||||
|
||||
from tht.session.models import local_principal
|
||||
|
||||
|
||||
def test_local_identity_uuid_is_stable_across_restarts(tmp_path):
|
||||
first = local_principal(tmp_path)
|
||||
restarted = local_principal(tmp_path)
|
||||
|
||||
assert first == restarted
|
||||
assert first.issuer == "local"
|
||||
assert uuid.UUID(first.subject, version=4).version == 4
|
||||
assert json.loads((tmp_path / "identity.json").read_text()) == {
|
||||
"issuer": "local",
|
||||
"subject": first.subject,
|
||||
}
|
||||
Reference in New Issue
Block a user