本文整理汇总了Python中product.Product.setAddStyle方法的典型用法代码示例。如果您正苦于以下问题:Python Product.setAddStyle方法的具体用法?Python Product.setAddStyle怎么用?Python Product.setAddStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类product.Product
的用法示例。
在下文中一共展示了Product.setAddStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_readAndSum
# 需要导入模块: from product import Product [as 别名]
# 或者: from product.Product import setAddStyle [as 别名]
def test_readAndSum(self):
sold=SalesProductList()
sold.addProductsCSV("./csvs/stock-sales_TEST.csv")
eA = Product()
eA.setAddStyle(SalesAddBehavior())
eA=eA.addStyle.addItem(eA, -4, 5, 10) #calculated manually
assert sold['602'].totalCost == eA.totalCost
assert sold['602'].count == eA.count
assert sold['602'].retail == eA.retail
示例2: test_totalSalesBySKU
# 需要导入模块: from product import Product [as 别名]
# 或者: from product.Product import setAddStyle [as 别名]
def test_totalSalesBySKU(self):
sold = SalesProductList()
sold.addProductsCSV("./csvs/stock-sales_TEST.csv")
eA = Product()
eA.setAddStyle(behavior_accumulate_retail())
eA = eA.addStyle.addItem(eA, -6, 5, 10) # calculated manually
assert sold['602'].totalCost == eA.totalCost
assert sold['602'].count == eA.count
assert sold['602'].retail == eA.retail
assert sold['602'].totalCost == -30
assert sold['602'].count == -6
assert sold['602'].retail == -60