feat-(move2lab2, postgres settings, repo base and other)

This commit is contained in:
2026-11-03 04:24:22 +03:00
parent 65003b6119
commit 273519109e
34 changed files with 1396 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
import requests
from conftest import base_url, auth
def test_foreign_chat_get(base_url, eve, chat):
response = requests.get(f"{base_url}/api/v1/chats/{chat['id']}",
headers=auth(eve))
assert response.status_code == 404
assert response.json()["error"]["code"] == "not_found"
def test_foreign_chat_messages(base_url, eve, chat):
response = requests.get(f"{base_url}/api/v1/chats/{chat['id']}/messages",
headers=auth(eve))
assert response.status_code == 404
assert response.json()["error"]["code"] == "not_found"
def test_foreign_chat_send_messages(base_url, eve, chat):
response = requests.post(f"{base_url}/api/v1/chats/{chat['id']}/messages",
headers=auth(eve),
json={"text": "Hello, I miss you"},
)
assert response.status_code == 404
assert response.json()["error"]["code"] == "not_found"
def test_foreign_chat_not_in_list(base_url, eve, chat):
response = requests.get(f"{base_url}/api/v1/chats?limit=100", headers=auth(eve))
assert response.status_code == 200
chat_ids = [c["id"] for c in response.json()["items"]]
assert chat["id"] not in chat_ids
def test_invalid_chat_id_format(base_url, alice):
response = requests.get(f"{base_url}/api/v1/chats/wrong_id",
headers=auth(alice))
assert response.status_code == 400
assert response.json()["error"]["code"] == "invalid_request"
def test_nonexistent_chat(base_url, alice):
response = requests.get(f"{base_url}/api/v1/chats/00000000-0000-0000-0000-000000000000",
headers=auth(alice))
assert response.status_code == 404
assert response.json()["error"]["code"] == "not_found"