-
Notifications
You must be signed in to change notification settings - Fork 637
Expand file tree
/
Copy pathtest_wave_04.py
More file actions
68 lines (56 loc) · 1.72 KB
/
test_wave_04.py
File metadata and controls
68 lines (56 loc) · 1.72 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import pytest
from swap_meet.vendor import Vendor
from swap_meet.item import Item
# @pytest.mark.skip
def test_swap_first_item_returns_true():
item_a = Item(category="clothing")
item_b = Item(category="clothing")
item_c = Item(category="clothing")
fatimah = Vendor(
inventory=[item_a, item_b, item_c]
)
item_d = Item(category="electronics")
item_e = Item(category="decor")
jolie = Vendor(
inventory=[item_d, item_e]
)
result = fatimah.swap_first_item(jolie)
assert len(fatimah.inventory) == 3
assert item_a not in fatimah.inventory
assert item_b in fatimah.inventory
assert item_c in fatimah.inventory
assert item_d in fatimah.inventory
assert len(jolie.inventory) == 2
assert item_d not in jolie.inventory
assert item_e in jolie.inventory
assert item_a in jolie.inventory
assert result
# @pytest.mark.skip
def test_swap_first_item_from_my_empty_returns_false():
fatimah = Vendor(
inventory=[]
)
item_d = Item(category="electronics")
item_e = Item(category="decor")
jolie = Vendor(
inventory=[item_d, item_e]
)
result = fatimah.swap_first_item(jolie)
assert len(fatimah.inventory) == 0
assert len(jolie.inventory) == 2
assert not result
# @pytest.mark.skip
def test_swap_first_item_from_their_empty_returns_false():
item_a = Item(category="clothing")
item_b = Item(category="clothing")
item_c = Item(category="clothing")
fatimah = Vendor(
inventory=[item_a, item_b, item_c]
)
jolie = Vendor(
inventory=[]
)
result = fatimah.swap_first_item(jolie)
assert len(fatimah.inventory) == 3
assert len(jolie.inventory) == 0
assert not result