mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-11 18:39:30 +00:00
test(tokens-repo): get new device key
This commit is contained in:
parent
f96d8b7d7c
commit
dc778b545e
|
@ -86,7 +86,7 @@ def null_keys(mocker, datadir):
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_new_device_key_generate(mocker):
|
def mock_new_device_key_generate(mocker):
|
||||||
mock = mocker.patch(
|
mock = mocker.patch(
|
||||||
"selfprivacy_api.repositories.tokens.json_tokens_repository.NewDeviceKey.generate",
|
"selfprivacy_api.models.tokens.new_device_key.NewDeviceKey.generate",
|
||||||
autospec=True,
|
autospec=True,
|
||||||
return_value=NewDeviceKey(
|
return_value=NewDeviceKey(
|
||||||
key="43478d05b35e4781598acd76e33832bb",
|
key="43478d05b35e4781598acd76e33832bb",
|
||||||
|
@ -449,15 +449,14 @@ def test_use_mnemonic_recovery_key(
|
||||||
##################
|
##################
|
||||||
|
|
||||||
|
|
||||||
def test_get_new_device_key(tokens, mock_new_device_key_generate):
|
def test_get_new_device_key(some_tokens_repo, mock_new_device_key_generate):
|
||||||
repo = JsonTokensRepository()
|
repo = some_tokens_repo
|
||||||
|
|
||||||
assert repo.get_new_device_key() is not None
|
assert repo.get_new_device_key() == NewDeviceKey(
|
||||||
# assert read_json(tokens / "tokens.json")["new_device"] == {
|
key="43478d05b35e4781598acd76e33832bb",
|
||||||
# "date": "2022-07-15T17:41:31.675698",
|
created_at=datetime(2022, 7, 15, 17, 41, 31, 675698),
|
||||||
# "expiration": "2022-07-15T17:41:31.675698",
|
expires_at=datetime(2022, 7, 15, 17, 41, 31, 675698),
|
||||||
# "token": "43478d05b35e4781598acd76e33832bb",
|
)
|
||||||
# }
|
|
||||||
|
|
||||||
|
|
||||||
def test_delete_new_device_key(tokens):
|
def test_delete_new_device_key(tokens):
|
||||||
|
|
Loading…
Reference in a new issue