GildedRose-Refactoring-Kata/python/texttest_fixture.py
Daniel Vu 0c5f5dca75 Adds support for conjured items
To avoid the goblin one-shotting me, I've extended his/her/their class
instead so we could add a `conjured` attribute. A decision was made to
fix the tests as as and add test coverage in future commits, for the
sake of treating this as a short exercise that shouldn't take more than
a couple of hours.
2021-04-05 15:21:07 -04:00

31 lines
1.2 KiB
Python

# -*- coding: utf-8 -*-
from __future__ import print_function
from gilded_rose import BaseItem as Item, GildedRose
if __name__ == "__main__":
print ("OMGHAI!")
items = [
Item(name="+5 Dexterity Vest", sell_in=10, quality=20),
Item(name="Aged Brie", sell_in=2, quality=0),
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=-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=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, conjured=True),
]
days = 2
import sys
if len(sys.argv) > 1:
days = int(sys.argv[1]) + 1
for day in range(days):
print("-------- day %s --------" % day)
print("name, sellIn, quality, conjured")
for item in items:
print(item)
print("")
GildedRose(items).update_quality()