Guest User

Untitled

a guest
Jun 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. $ python recipe21_report.py recipe21
  2. ===============================
  3. == Processing module recipe21
  4. ===============================
  5. Documentation for module recipe21
  6. -------------------------------
  7.  
  8. This is documentation for the this entire recipe.
  9. With it, we can demonstrate usage of the code.
  10.  
  11. >>> cart = ShoppingCart().add("tuna sandwich", 15.0)
  12. >>> len(cart)
  13. 1
  14. >>> cart.item(1)
  15. 'tuna sandwich'
  16. >>> cart.price(1)
  17. 15.0
  18. >>> print round(cart.total(9.25), 2)
  19. 16.39
  20.  
  21. -------------------------------
  22. Documentation for Item.module Item - None
  23. Documentation for Item.__init__() - None
  24. Documentation for ShoppingCart.module ShoppingCart
  25. -------------------------------
  26.  
  27. This object is used to store the goods.
  28. It conveniently calculates total cost including
  29. tax.
  30.  
  31. -------------------------------
  32. Documentation for ShoppingCart.__init__() - None
  33. Documentation for ShoppingCart.__len__()
  34. -------------------------------
  35. Support len(cart) operation.
  36. -------------------------------
  37. Documentation for ShoppingCart.add()
  38. -------------------------------
  39. Add an item to the internal list.
  40. -------------------------------
  41. Documentation for ShoppingCart.item()
  42. -------------------------------
  43. Look up the item. The cart is a 1-based index.
  44. -------------------------------
  45. Documentation for ShoppingCart.price()
  46. -------------------------------
  47. Look up the price. The cart is a 1-based index.
  48. -------------------------------
  49. Documentation for ShoppingCart.total()
  50. -------------------------------
  51. Add up all costs, and then apply a sales tax.
  52. -------------------------------
  53. Running doctests for recipe21
  54. -------------------------------
  55. (ptc)gturnquist-mbp:03 gturnquist$ python recipe21_report.py recipe21 -v
  56. ===============================
  57. == Processing module recipe21
  58. ===============================
  59. Documentation for module recipe21
  60. -------------------------------
  61.  
  62. This is documentation for the this entire recipe.
  63. With it, we can demonstrate usage of the code.
  64.  
  65. >>> cart = ShoppingCart().add("tuna sandwich", 15.0)
  66. >>> len(cart)
  67. 1
  68. >>> cart.item(1)
  69. 'tuna sandwich'
  70. >>> cart.price(1)
  71. 15.0
  72. >>> print round(cart.total(9.25), 2)
  73. 16.39
  74.  
  75. -------------------------------
  76. Documentation for Item.module Item - None
  77. Documentation for Item.__init__() - None
  78. Documentation for ShoppingCart.module ShoppingCart
  79. -------------------------------
  80.  
  81. This object is used to store the goods.
  82. It conveniently calculates total cost including
  83. tax.
  84.  
  85. -------------------------------
  86. Documentation for ShoppingCart.__init__() - None
  87. Documentation for ShoppingCart.__len__()
  88. -------------------------------
  89. Support len(cart) operation.
  90. -------------------------------
  91. Documentation for ShoppingCart.add()
  92. -------------------------------
  93. Add an item to the internal list.
  94. -------------------------------
  95. Documentation for ShoppingCart.item()
  96. -------------------------------
  97. Look up the item. The cart is a 1-based index.
  98. -------------------------------
  99. Documentation for ShoppingCart.price()
  100. -------------------------------
  101. Look up the price. The cart is a 1-based index.
  102. -------------------------------
  103. Documentation for ShoppingCart.total()
  104. -------------------------------
  105. Add up all costs, and then apply a sales tax.
  106. -------------------------------
  107. Running doctests for recipe21
  108. -------------------------------
  109. Trying:
  110. cart = ShoppingCart().add("tuna sandwich", 15.0)
  111. Expecting nothing
  112. ok
  113. Trying:
  114. len(cart)
  115. Expecting:
  116. 1
  117. ok
  118. Trying:
  119. cart.item(1)
  120. Expecting:
  121. 'tuna sandwich'
  122. ok
  123. Trying:
  124. cart.price(1)
  125. Expecting:
  126. 15.0
  127. ok
  128. Trying:
  129. print round(cart.total(9.25), 2)
  130. Expecting:
  131. 16.39
  132. ok
  133. 9 items had no tests:
  134. recipe21.Item
  135. recipe21.Item.__init__
  136. recipe21.ShoppingCart
  137. recipe21.ShoppingCart.__init__
  138. recipe21.ShoppingCart.__len__
  139. recipe21.ShoppingCart.add
  140. recipe21.ShoppingCart.item
  141. recipe21.ShoppingCart.price
  142. recipe21.ShoppingCart.total
  143. 1 items passed all tests:
  144. 5 tests in recipe21
  145. 5 tests in 10 items.
  146. 5 passed and 0 failed.
  147. Test passed.
Add Comment
Please, Sign In to add comment