31 lines
630 B
Python
31 lines
630 B
Python
|
"""Test configuration and global fixtures
|
||
|
"""
|
||
|
|
||
|
from ed25519 import SigningKey
|
||
|
import pytest
|
||
|
from _pytest.fixtures import SubRequest
|
||
|
|
||
|
from earthsnake.identity import Identity
|
||
|
|
||
|
from .helpers import random_name
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def identity(request: SubRequest) -> Identity:
|
||
|
"""A valid identity"""
|
||
|
|
||
|
seed = b''
|
||
|
name = random_name()
|
||
|
|
||
|
for marker in request.node.iter_markers('id_key_seed'):
|
||
|
for seed in marker.args:
|
||
|
pass
|
||
|
|
||
|
for marker in request.node.iter_markers('id_name'):
|
||
|
for name in marker.args:
|
||
|
pass
|
||
|
|
||
|
sign = SigningKey(seed)
|
||
|
|
||
|
return Identity(name, sign_key=sign)
|