Linting
This commit is contained in:
parent
fbe40107be
commit
f0be12394c
5 changed files with 18 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
|||
from collections.abc import AsyncGenerator
|
||||
|
||||
from cryptography.fernet import Fernet
|
||||
import pytest
|
||||
from cryptography.fernet import Fernet
|
||||
from fastapi.testclient import TestClient
|
||||
from pydantic_settings import SettingsConfigDict
|
||||
from redis import asyncio as aioredis
|
||||
|
@ -31,7 +31,7 @@ def get_test_settings() -> Settings:
|
|||
return TestSettings()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture
|
||||
def fernet(settings: Settings) -> Fernet:
|
||||
return get_fernet(settings)
|
||||
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
from cryptography.fernet import Fernet, InvalidToken
|
||||
import pytest
|
||||
from pssecret_server.utils import encrypt_secret, decrypt_secret
|
||||
from cryptography.fernet import Fernet, InvalidToken
|
||||
|
||||
from pssecret_server.utils import decrypt_secret, encrypt_secret
|
||||
|
||||
from ..factories import SecretFactory
|
||||
|
||||
|
||||
def test_encrypte_secret_ok(fernet: Fernet):
|
||||
secret = SecretFactory().build()
|
||||
encrypted_secret = encrypt_secret(secret, fernet)
|
||||
|
||||
|
||||
assert secret.data != encrypted_secret.data
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue