Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ python recipe21_report.py recipe21
- ===============================
- == Processing module recipe21
- ===============================
- Documentation for module recipe21
- -------------------------------
- This is documentation for the this entire recipe.
- With it, we can demonstrate usage of the code.
- >>> cart = ShoppingCart().add("tuna sandwich", 15.0)
- >>> len(cart)
- 1
- >>> cart.item(1)
- 'tuna sandwich'
- >>> cart.price(1)
- 15.0
- >>> print round(cart.total(9.25), 2)
- 16.39
- -------------------------------
- Documentation for Item.module Item - None
- Documentation for Item.__init__() - None
- Documentation for ShoppingCart.module ShoppingCart
- -------------------------------
- This object is used to store the goods.
- It conveniently calculates total cost including
- tax.
- -------------------------------
- Documentation for ShoppingCart.__init__() - None
- Documentation for ShoppingCart.__len__()
- -------------------------------
- Support len(cart) operation.
- -------------------------------
- Documentation for ShoppingCart.add()
- -------------------------------
- Add an item to the internal list.
- -------------------------------
- Documentation for ShoppingCart.item()
- -------------------------------
- Look up the item. The cart is a 1-based index.
- -------------------------------
- Documentation for ShoppingCart.price()
- -------------------------------
- Look up the price. The cart is a 1-based index.
- -------------------------------
- Documentation for ShoppingCart.total()
- -------------------------------
- Add up all costs, and then apply a sales tax.
- -------------------------------
- Running doctests for recipe21
- -------------------------------
- (ptc)gturnquist-mbp:03 gturnquist$ python recipe21_report.py recipe21 -v
- ===============================
- == Processing module recipe21
- ===============================
- Documentation for module recipe21
- -------------------------------
- This is documentation for the this entire recipe.
- With it, we can demonstrate usage of the code.
- >>> cart = ShoppingCart().add("tuna sandwich", 15.0)
- >>> len(cart)
- 1
- >>> cart.item(1)
- 'tuna sandwich'
- >>> cart.price(1)
- 15.0
- >>> print round(cart.total(9.25), 2)
- 16.39
- -------------------------------
- Documentation for Item.module Item - None
- Documentation for Item.__init__() - None
- Documentation for ShoppingCart.module ShoppingCart
- -------------------------------
- This object is used to store the goods.
- It conveniently calculates total cost including
- tax.
- -------------------------------
- Documentation for ShoppingCart.__init__() - None
- Documentation for ShoppingCart.__len__()
- -------------------------------
- Support len(cart) operation.
- -------------------------------
- Documentation for ShoppingCart.add()
- -------------------------------
- Add an item to the internal list.
- -------------------------------
- Documentation for ShoppingCart.item()
- -------------------------------
- Look up the item. The cart is a 1-based index.
- -------------------------------
- Documentation for ShoppingCart.price()
- -------------------------------
- Look up the price. The cart is a 1-based index.
- -------------------------------
- Documentation for ShoppingCart.total()
- -------------------------------
- Add up all costs, and then apply a sales tax.
- -------------------------------
- Running doctests for recipe21
- -------------------------------
- Trying:
- cart = ShoppingCart().add("tuna sandwich", 15.0)
- Expecting nothing
- ok
- Trying:
- len(cart)
- Expecting:
- 1
- ok
- Trying:
- cart.item(1)
- Expecting:
- 'tuna sandwich'
- ok
- Trying:
- cart.price(1)
- Expecting:
- 15.0
- ok
- Trying:
- print round(cart.total(9.25), 2)
- Expecting:
- 16.39
- ok
- 9 items had no tests:
- recipe21.Item
- recipe21.Item.__init__
- recipe21.ShoppingCart
- recipe21.ShoppingCart.__init__
- recipe21.ShoppingCart.__len__
- recipe21.ShoppingCart.add
- recipe21.ShoppingCart.item
- recipe21.ShoppingCart.price
- recipe21.ShoppingCart.total
- 1 items passed all tests:
- 5 tests in recipe21
- 5 tests in 10 items.
- 5 passed and 0 failed.
- Test passed.
Add Comment
Please, Sign In to add comment