هذا الالتزام موجود في:
ahmedgamalyousef
2025-10-01 00:05:36 +03:00
الأصل 41ba57fccc
التزام efa5d907c9
4 ملفات معدلة مع 346 إضافات و70 حذوفات

عرض الملف

@@ -503,3 +503,288 @@ Status: 200
--------------------------------------
✅ Tests completed at Tue 30 Sep 2025 11:14:57 PM EEST
======================================
🚀 Running API tests at Tue 30 Sep 2025 11:33:16 PM EEST
======================================
🔹 Testing /health
{
"service": "fruit-api",
"status": "healthy",
"timestamp": "2025-09-30T20:33:16.885319"
}
Status: 200
--------------------------------------
🔹 Testing GET /fruits
{
"fruits": [
{
"category": "Tropical",
"color": "Red",
"id": 1,
"name": "Apple",
"price": 1.5,
"quantity": 100
},
{
"category": "Tropical",
"color": "Yellow",
"id": 2,
"name": "Banana",
"price": 0.75,
"quantity": 150
},
{
"category": "Citrus",
"color": "Orange",
"id": 3,
"name": "Orange",
"price": 1.2,
"quantity": 80
}
],
"total": 3
}
Status: 200
--------------------------------------
🔹 Testing GET /fruits/1
{
"fruit": {
"category": "Tropical",
"color": "Red",
"id": 1,
"name": "Apple",
"price": 1.5,
"quantity": 100
}
}
Status: 200
--------------------------------------
🔹 Testing POST /fruits
{
"fruit": {
"category": "Tropical",
"color": "Yellow",
"created_at": "2025-09-30T20:33:17.044131",
"id": 4,
"name": "Mango",
"price": 2.5,
"quantity": 50
},
"message": "Fruit created successfully"
}
Status: 201
--------------------------------------
🔹 Testing PUT /fruits/1
{
"fruit": {
"category": "Tropical",
"color": "Red",
"id": 1,
"name": "Green Apple",
"price": 1.8,
"quantity": 100,
"updated_at": "2025-09-30T20:33:17.097781"
},
"message": "Fruit updated successfully"
}
Status: 200
--------------------------------------
🔹 Testing DELETE /fruits/1
{
"deleted_fruit": {
"category": "Tropical",
"color": "Red",
"id": 1,
"name": "Green Apple",
"price": 1.8,
"quantity": 100,
"updated_at": "2025-09-30T20:33:17.097781"
},
"message": "Fruit deleted successfully"
}
Status: 200
--------------------------------------
🔹 Testing GET /fruits/search?name=apple
{
"count": 0,
"results": [],
"search_term": "apple"
}
Status: 200
--------------------------------------
🔹 Testing GET /fruits/category/Tropical
{
"category": "Tropical",
"count": 2,
"fruits": [
{
"category": "Tropical",
"color": "Yellow",
"id": 2,
"name": "Banana",
"price": 0.75,
"quantity": 150
},
{
"category": "Tropical",
"color": "Yellow",
"created_at": "2025-09-30T20:33:17.044131",
"id": 4,
"name": "Mango",
"price": 2.5,
"quantity": 50
}
]
}
Status: 200
--------------------------------------
✅ Tests completed at Tue 30 Sep 2025 11:33:17 PM EEST
======================================
🚀 Running API tests at Tue 30 Sep 2025 11:43:33 PM EEST
======================================
🔹 Testing /health
{
"service": "fruit-api",
"status": "healthy",
"timestamp": "2025-09-30T20:43:33.115100"
}
Status: 200
--------------------------------------
🔹 Testing GET /fruits
{
"fruits": [
{
"category": "Tropical",
"color": "Yellow",
"id": 2,
"name": "Banana",
"price": 0.75,
"quantity": 150
},
{
"category": "Citrus",
"color": "Orange",
"id": 3,
"name": "Orange",
"price": 1.2,
"quantity": 80
},
{
"category": "Tropical",
"color": "Yellow",
"created_at": "2025-09-30T20:33:17.044131",
"id": 4,
"name": "Mango",
"price": 2.5,
"quantity": 50
}
],
"total": 3
}
Status: 200
--------------------------------------
🔹 Testing GET /fruits/1
{
"error": "Fruit not found"
}
Status: 404
--------------------------------------
🔹 Testing POST /fruits
{
"fruit": {
"category": "Tropical",
"color": "Yellow",
"created_at": "2025-09-30T20:43:33.358989",
"id": 4,
"name": "Mango",
"price": 2.5,
"quantity": 50
},
"message": "Fruit created successfully"
}
Status: 201
--------------------------------------
🔹 Testing PUT /fruits/1
{
"error": "Fruit not found"
}
Status: 404
--------------------------------------
🔹 Testing DELETE /fruits/1
{
"error": "Fruit not found"
}
Status: 404
--------------------------------------
🔹 Testing GET /fruits/search?name=apple
{
"count": 0,
"results": [],
"search_term": "apple"
}
Status: 200
--------------------------------------
🔹 Testing GET /fruits/category/Tropical
{
"category": "Tropical",
"count": 3,
"fruits": [
{
"category": "Tropical",
"color": "Yellow",
"id": 2,
"name": "Banana",
"price": 0.75,
"quantity": 150
},
{
"category": "Tropical",
"color": "Yellow",
"created_at": "2025-09-30T20:33:17.044131",
"id": 4,
"name": "Mango",
"price": 2.5,
"quantity": 50
},
{
"category": "Tropical",
"color": "Yellow",
"created_at": "2025-09-30T20:43:33.358989",
"id": 4,
"name": "Mango",
"price": 2.5,
"quantity": 50
}
]
}
Status: 200
--------------------------------------
✅ Tests completed at Tue 30 Sep 2025 11:43:33 PM EEST
======================================
✅ Status: 200
✅ Status: 200
✅ Status: 200
✅ Status: 201
✅ Status: 200
✅ Status: 200
✅ Status: 200
✅ Status: 201
✅ Status: 200
✅ Status: 200
✅ Status: 200
✅ Status: 201