-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_guilded_rose.py
More file actions
24 lines (22 loc) · 1.05 KB
/
test_guilded_rose.py
File metadata and controls
24 lines (22 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
import unittest
from gilded_rose import Item, GildedRose
examples = (("item_name", "initial_quality", "initial_sellin", "updated_quality",\
"updated_sellin", "comment"),
(("foo", 0, 0, 0, -1, "typical item"),
("foo", 10, 0, 8, -1, "typical item"),
("Sulfuras, Hand of Ragnaros", 0, 0, 0, 0, "exceptional item"),
("Sulfuras, Hand of Ragnaros", 10, 0, 10, 0, "exceptional item"),
("Sulfuras, Hand of Ragnaros", 10, -1, 10, -1, "exceptional item"),
("Aged Brie", 0, 0, 2, -1, "brie item"),
("Backstage passes to a TAFKAL80ETC concert", 0, 0, 0, -1, "backstage pass\
item"),
))
@pytest.mark.parametrize(*examples)
def test_update_quality(item_name, initial_quality, initial_sellin, updated_quality,
updated_sellin, comment):
item = Item(item_name, initial_sellin, initial_quality)
gilded_rose = GildedRose([item])
gilded_rose.update_quality()
assert item.quality == updated_quality
assert item.sell_in == updated_sellin