Вопрос пользователя:
Ответ нейросети:
import pytest import requests
def test_create_project_positive(): url = "http://yougile.com/api-v2/projects" data = { "name": "Test Project", "description": "This is a test project" } response = requests.post(url, json=data) assert response.status_code == 200 assert "id" in response.json()
def test_create_project_negative(): url = "http://yougile.com/api-v2/projects" data = { "description": "This is a test project" } response = requests.post(url, json=data) assert response.status_code == 400
def test_update_project_positive(): url = "http://yougile.com/api-v2/projects/1" data = { "name": "Updated Project", "description": "This is an updated project" } response = requests.put(url, json=data) assert response.status_code == 200
def test_update_project_negative(): url = "http://yougile.com/api-v2/projects/999" data = { "name": "Updated Project", "description": "This is an updated project" } response = requests.put(url, json=data) assert response.status_code == 404
def test_get_project_positive(): url = "http://yougile.com/api-v2/projects/1" response = requests.get(url) assert response.status_code == 200 assert "name" in response.json()
def test_get_project_negative(): url = "http://yougile.com/api-v2/projects/999" response = requests.get(url) assert response.status_code == 404
Напишите нам, если в вопросе есть ваши персональные данные ([email protected])
Обратите внимание: ответы, предоставляемые искусственным интеллектом, могут не всегда быть точными. Не рассчитывайте на них в критически важных областях, таких как медицина, юриспруденция, финансы или в вопросах, связанных с безопасностью. Для важных решений всегда обращайтесь к квалифицированным специалистам. Администрация сайта не несет ответственности за контент, сгенерированный автоматически.