Skip to content

Commit 54b16b4

Browse files
committed
add test
Signed-off-by: Bradley Reynolds <[email protected]>
1 parent c97efe6 commit 54b16b4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_generators.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""Test the generators module"""
2+
3+
import uuid
4+
5+
from fastapi.testclient import TestClient
6+
7+
from api.server import app
8+
9+
client = TestClient(app)
10+
11+
12+
def test_read_random_numbers():
13+
response = client.post("/generators/uuids/", json={"uuid_type": 1, "quantity": 1})
14+
assert response.status_code == 200
15+
first = response.json()["uuids"][0]
16+
assert isinstance(uuid.UUID(first), uuid.UUID)

0 commit comments

Comments
 (0)