-
Notifications
You must be signed in to change notification settings - Fork 637
Expand file tree
/
Copy pathtest_wave_02.py
More file actions
44 lines (37 loc) · 1.29 KB
/
test_wave_02.py
File metadata and controls
44 lines (37 loc) · 1.29 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import pytest
from swap_meet.vendor import Vendor
from swap_meet.item import Item
# @pytest.mark.skip
def test_items_have_blank_default_category():
item = Item()
assert item.category == ""
# @pytest.mark.skip
def test_get_items_by_category():
item_a = Item(category="clothing")
item_b = Item(category="electronics")
item_c = Item(category="clothing")
vendor = Vendor(
inventory=[item_a, item_b, item_c]
)
items = vendor.get_by_category("clothing")
assert len(items) == 2
assert item_a in items
assert item_c in items
assert item_b not in items
# @pytest.mark.skip
def test_get_no_matching_items_by_category():
item_a = Item(category="clothing")
item_b = Item(category="clothing")
item_c = Item(category="clothing")
vendor = Vendor(
inventory=[item_a, item_b, item_c]
)
items = vendor.get_by_category("electronics")
# raise Exception("Complete this test according to comments below.")
# *********************************************************************
# ****** Complete Assert Portion of this test **********
assert len(items) == 0
assert item_a not in items
assert item_c not in items
assert item_b not in items
# *********************************************************************