Skip to content

Commit 0337f32

Browse files
authored
Update test_secrets_store.py
1 parent 3431264 commit 0337f32

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎tests/test_secrets_store.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import pytest
66
from cryptography.fernet import Fernet
77

8-
from app.core import secrets_store
8+
from app.infra import secrets_store
99

1010

1111
def test_explicit_fernet_key_used(monkeypatch: pytest.MonkeyPatch) -> None:
12-
from app.core.config import get_settings
12+
from app.infra.config import get_settings
1313

1414
key = Fernet.generate_key().decode()
1515
monkeypatch.setattr(get_settings(), "fernet_key", key)
@@ -18,15 +18,15 @@ def test_explicit_fernet_key_used(monkeypatch: pytest.MonkeyPatch) -> None:
1818

1919

2020
def test_bad_fernet_key_raises(monkeypatch: pytest.MonkeyPatch) -> None:
21-
from app.core.config import get_settings
21+
from app.infra.config import get_settings
2222

2323
monkeypatch.setattr(get_settings(), "fernet_key", "not-a-valid-fernet-key")
2424
with pytest.raises(ValueError, match="32 url-safe base64"):
2525
secrets_store.encrypt("payload")
2626

2727

2828
def test_decrypt_wrong_key_raises(monkeypatch: pytest.MonkeyPatch) -> None:
29-
from app.core.config import get_settings
29+
from app.infra.config import get_settings
3030

3131
token = secrets_store.encrypt("payload")
3232
monkeypatch.setattr(get_settings(), "fernet_key", Fernet.generate_key().decode())
@@ -35,7 +35,7 @@ def test_decrypt_wrong_key_raises(monkeypatch: pytest.MonkeyPatch) -> None:
3535

3636

3737
def test_derived_key_survives_restart(monkeypatch: pytest.MonkeyPatch) -> None:
38-
from app.core.config import get_settings
38+
from app.infra.config import get_settings
3939

4040
monkeypatch.setattr(get_settings(), "fernet_key", "")
4141
token = secrets_store.encrypt("stable")

0 commit comments

Comments
 (0)