major refactoring adding vendor and customer features
This commit is contained in:
@@ -229,23 +229,23 @@ class TestProductService:
|
||||
assert exc_info.value.error_code == "PRODUCT_NOT_FOUND"
|
||||
assert "NONEXISTENT" in str(exc_info.value)
|
||||
|
||||
def test_get_stock_info_success(self, db, test_marketplace_product_with_stock):
|
||||
"""Test getting stock info for product with stock"""
|
||||
def test_get_inventory_info_success(self, db, test_marketplace_product_with_inventory):
|
||||
"""Test getting inventory info for product with inventory"""
|
||||
# Extract the product from the dictionary
|
||||
marketplace_product = test_marketplace_product_with_stock['marketplace_product']
|
||||
marketplace_product = test_marketplace_product_with_inventory['marketplace_product']
|
||||
|
||||
stock_info = self.service.get_stock_info(db, marketplace_product.gtin)
|
||||
inventory_info = self.service.get_inventory_info(db, marketplace_product.gtin)
|
||||
|
||||
assert stock_info is not None
|
||||
assert stock_info.gtin == marketplace_product.gtin
|
||||
assert stock_info.total_quantity > 0
|
||||
assert len(stock_info.locations) > 0
|
||||
assert inventory_info is not None
|
||||
assert inventory_info.gtin == marketplace_product.gtin
|
||||
assert inventory_info.total_quantity > 0
|
||||
assert len(inventory_info.locations) > 0
|
||||
|
||||
def test_get_stock_info_no_stock(self, db, test_marketplace_product):
|
||||
"""Test getting stock info for product without stock"""
|
||||
stock_info = self.service.get_stock_info(db, test_marketplace_product.gtin or "1234567890123")
|
||||
def test_get_inventory_info_no_inventory(self, db, test_marketplace_product):
|
||||
"""Test getting inventory info for product without inventory"""
|
||||
inventory_info = self.service.get_inventory_info(db, test_marketplace_product.gtin or "1234567890123")
|
||||
|
||||
assert stock_info is None
|
||||
assert inventory_info is None
|
||||
|
||||
def test_product_exists_true(self, db, test_marketplace_product):
|
||||
"""Test product_exists returns True for existing product"""
|
||||
|
||||
Reference in New Issue
Block a user