Test empty secret is not accepted

This commit is contained in:
Ivan Golikov 2025-01-06 17:27:20 +01:00
parent e6bbd01ea9
commit 3fb4d18db8

View file

@ -3,6 +3,13 @@ from fastapi.testclient import TestClient
from tests.factories import SecretFactory
def test_empty_secret_is_not_accepted(client: TestClient):
response = client.post("/secret", json={"data": ""})
assert response.status_code == 422
assert "data" in response.text
def test_store_secret_returns_key(client: TestClient):
response = client.post("/secret", json=dict(SecretFactory().build()))