Skip to content

Commit 662e8ba

Browse files
committed
tests: add non-uuid test
1 parent 3173e95 commit 662e8ba

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/server/api/tests/test_api.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,3 +604,28 @@ async def test_api_event_search(
604604
d = response.json()
605605
assert response.status_code == 200
606606
assert d["errno"] == 0
607+
608+
609+
@pytest.mark.asyncio
610+
async def test_api_non_uuid_access(client, db_env):
611+
612+
fake_uid = "fake"
613+
614+
response = client.post(
615+
f"{PREFIX}/blobs/insert/{fake_uid}",
616+
json={
617+
"blob_type": "chat",
618+
"blob_data": {
619+
"messages": [
620+
{"role": "user", "content": "hello, I'm Gus"},
621+
{"role": "assistant", "content": "hi"},
622+
]
623+
},
624+
},
625+
)
626+
assert response.status_code == 422
627+
628+
response = client.get(
629+
f"{PREFIX}/users/{fake_uid}",
630+
)
631+
assert response.status_code == 422

0 commit comments

Comments
 (0)