Main exception renamed to WizamartException
This commit is contained in:
@@ -434,14 +434,14 @@ class TestInventoryAPI:
|
||||
assert data["error_code"] == "VALIDATION_ERROR"
|
||||
|
||||
def test_exception_structure_consistency(self, client, auth_headers):
|
||||
"""Test that all inventory exceptions follow the consistent LetzShopException structure"""
|
||||
"""Test that all inventory exceptions follow the consistent WizamartException structure"""
|
||||
# Test with a known error case
|
||||
response = client.get("/api/v1/inventory/9999999999999", headers=auth_headers)
|
||||
|
||||
assert response.status_code == 404
|
||||
data = response.json()
|
||||
|
||||
# Verify exception structure matches LetzShopException.to_dict()
|
||||
# Verify exception structure matches WizamartException.to_dict()
|
||||
required_fields = ["error_code", "message", "status_code"]
|
||||
for field in required_fields:
|
||||
assert field in data, f"Missing required field: {field}"
|
||||
|
||||
@@ -329,14 +329,14 @@ class TestMarketplaceProductsAPI:
|
||||
assert data["status_code"] == 401
|
||||
|
||||
def test_exception_structure_consistency(self, client, auth_headers):
|
||||
"""Test that all exceptions follow the consistent LetzShopException structure"""
|
||||
"""Test that all exceptions follow the consistent WizamartException structure"""
|
||||
# Test with a known error case
|
||||
response = client.get("/api/v1/marketplace/product/NONEXISTENT", headers=auth_headers)
|
||||
|
||||
assert response.status_code == 404
|
||||
data = response.json()
|
||||
|
||||
# Verify exception structure matches LetzShopException.to_dict()
|
||||
# Verify exception structure matches WizamartException.to_dict()
|
||||
required_fields = ["error_code", "message", "status_code"]
|
||||
for field in required_fields:
|
||||
assert field in data, f"Missing required field: {field}"
|
||||
|
||||
@@ -299,7 +299,7 @@ class TestPagination:
|
||||
assert response.status_code == 422
|
||||
data = response.json()
|
||||
|
||||
# Verify exception structure matches LetzShopException.to_dict()
|
||||
# Verify exception structure matches WizamartException.to_dict()
|
||||
required_fields = ["error_code", "message", "status_code"]
|
||||
for field in required_fields:
|
||||
assert field in data, f"Missing required field: {field}"
|
||||
|
||||
@@ -368,14 +368,14 @@ class TestVendorsAPI:
|
||||
assert data["error_code"] == "VALIDATION_ERROR"
|
||||
|
||||
def test_exception_structure_consistency(self, client, auth_headers):
|
||||
"""Test that all vendor exceptions follow the consistent LetzShopException structure"""
|
||||
"""Test that all vendor exceptions follow the consistent WizamartException structure"""
|
||||
# Test with a known error case
|
||||
response = client.get("/api/v1/vendor/NONEXISTENT", headers=auth_headers)
|
||||
|
||||
assert response.status_code == 404
|
||||
data = response.json()
|
||||
|
||||
# Verify exception structure matches LetzShopException.to_dict()
|
||||
# Verify exception structure matches WizamartException.to_dict()
|
||||
required_fields = ["error_code", "message", "status_code"]
|
||||
for field in required_fields:
|
||||
assert field in data, f"Missing required field: {field}"
|
||||
|
||||
Reference in New Issue
Block a user