Made print a function from the future. Added more items to cover all the branches of the code.

This commit is contained in:
Andreas Ekeroot 2012-03-08 11:53:56 +01:00
parent c307d9e5dc
commit bf68d49d55

View File

@ -1,3 +1,4 @@
from __future__ import print_function
def update_quality(items): def update_quality(items):
for item in items: for item in items:
@ -46,8 +47,11 @@ if __name__ == "__main__":
Item(name="Aged Brie", sell_in=2, quality=0), Item(name="Aged Brie", sell_in=2, quality=0),
Item(name="Elixir of the Mongoose", sell_in=5, quality=7), Item(name="Elixir of the Mongoose", sell_in=5, quality=7),
Item(name="Sulfuras, Hand of Ragnaros", sell_in=0, quality=80), Item(name="Sulfuras, Hand of Ragnaros", sell_in=0, quality=80),
Item(name="Sulfuras, Hand of Ragnaros", sell_in=-1, quality=80),
Item(name="Backstage passes to a TAFKAL80ETC concert", sell_in=15, quality=20), Item(name="Backstage passes to a TAFKAL80ETC concert", sell_in=15, quality=20),
Item(name="Conjured Mana Cake", sell_in=3, quality=6), Item(name="Backstage passes to a TAFKAL80ETC concert", sell_in=10, quality=49),
Item(name="Backstage passes to a TAFKAL80ETC concert", sell_in=5, quality=49),
Item(name="Conjured Mana Cake", sell_in=3, quality=6), # <-- :O
] ]
days = 2 days = 2
@ -60,4 +64,4 @@ if __name__ == "__main__":
for item in items: for item in items:
print(item) print(item)
print("") print("")
update_quality(items) update_quality(items)