Test empty secret is not accepted
This commit is contained in:
parent
e6bbd01ea9
commit
3fb4d18db8
1 changed files with 7 additions and 0 deletions
|
@ -3,6 +3,13 @@ from fastapi.testclient import TestClient
|
||||||
from tests.factories import SecretFactory
|
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):
|
def test_store_secret_returns_key(client: TestClient):
|
||||||
response = client.post("/secret", json=dict(SecretFactory().build()))
|
response = client.post("/secret", json=dict(SecretFactory().build()))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue