Updating Files
هذا الالتزام موجود في:
285
test_results.log
285
test_results.log
@@ -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
|
||||
|
المرجع في مشكلة جديدة
حظر مستخدم