Move the default testing identity seed to tests/helpers.py
This commit is contained in:
parent
5e57b24200
commit
b585814ab8
@ -7,7 +7,7 @@ from _pytest.fixtures import SubRequest
|
|||||||
|
|
||||||
from earthsnake.identity import Identity
|
from earthsnake.identity import Identity
|
||||||
|
|
||||||
from .helpers import random_name
|
from .helpers import DEFAULT_IDENTITY_SEED, random_name
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@ -21,6 +21,8 @@ def identity(request: SubRequest) -> Identity:
|
|||||||
for seed in marker.args:
|
for seed in marker.args:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
seed = seed or DEFAULT_IDENTITY_SEED
|
||||||
|
|
||||||
for marker in request.node.iter_markers('id_name'):
|
for marker in request.node.iter_markers('id_name'):
|
||||||
for name in marker.args:
|
for name in marker.args:
|
||||||
pass
|
pass
|
||||||
|
@ -5,6 +5,11 @@ from random import choice
|
|||||||
|
|
||||||
from earthsnake.types import ALPHA_LOWER, ALPHA_LOWER_OR_DIGIT
|
from earthsnake.types import ALPHA_LOWER, ALPHA_LOWER_OR_DIGIT
|
||||||
|
|
||||||
|
DEFAULT_IDENTITY_SEED = (
|
||||||
|
b'\xe5:\xc9\x95$\x9d\xc5F\xee\xe6\x84\xbe\xcc\xda^\xc4'
|
||||||
|
b'z\x84\xb7\xd2\x02q\xfa\xe8W\xd8z\x05E\xfb2\xd5'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def random_name() -> str:
|
def random_name() -> str:
|
||||||
"""Generate a valid random author name"""
|
"""Generate a valid random author name"""
|
||||||
|
@ -9,12 +9,8 @@ from pytest_mock.plugin import MockerFixture
|
|||||||
from earthsnake.exc import ValidationError
|
from earthsnake.exc import ValidationError
|
||||||
from earthsnake.identity import Identity
|
from earthsnake.identity import Identity
|
||||||
|
|
||||||
from .helpers import random_name
|
from .helpers import DEFAULT_IDENTITY_SEED as TEST_SEED, random_name
|
||||||
|
|
||||||
TEST_SEED = (
|
|
||||||
b'\xe5:\xc9\x95$\x9d\xc5F\xee\xe6\x84\xbe\xcc\xda^\xc4'
|
|
||||||
b'z\x84\xb7\xd2\x02q\xfa\xe8W\xd8z\x05E\xfb2\xd5'
|
|
||||||
)
|
|
||||||
TEST_MNEMONIC = bip39.encode_bytes(TEST_SEED)
|
TEST_MNEMONIC = bip39.encode_bytes(TEST_SEED)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user