Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lions C18 LP Wilson Swap Meet #21

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

theLP100
Copy link

@theLP100 theLP100 commented Oct 5, 2022

No description provided.

Copy link

@nancy-harris nancy-harris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent job! Your code overall was great. There were a few places where the code could be simpler/cleaner. See comments below.

For commits, it would be great if the commit messages could be more descriptive. Instead of writing about which wave was completed, consider messages like "Created Item class" or "Added swap_items function".


class Clothing(Item):
def __init__(self, category = "Clothing", condition = 0.0):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually do not want to have category in the __init__ function. We want the category to always be "Clothing", but if we put category here, the user can set category to whatever they want, which isn't good!

from swap_meet.item import Item

class Decor(Item):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

pass
from swap_meet.item import Item

class Electronics(Item):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@@ -1,2 +1,17 @@
class Item:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

methods: .add(item), .remove(item), .get_by_category(category),
swap_items(swapping_vendor, my_item, their_item)"""
def __init__(self, inventory = None):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

Comment on lines +38 to +40
assert item_a not in items
assert item_b not in items
assert item_c not in items

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great asserts! These are actually not needed though. Based on the first assert, we know the list is empty. We don't need to check that each of these individual items are in the list.

Comment on lines +79 to +90
#assert
assert result
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3

assert item_f in tai.inventory
assert item_a in tai.inventory
assert item_b in tai.inventory

@pytest.mark.skip
assert item_c in jesse.inventory
assert item_d in jesse.inventory
assert item_e in jesse.inventory

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

Comment on lines +117 to +129
assert result
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3

assert item_f in tai.inventory
assert item_a in tai.inventory
assert item_b in tai.inventory
assert item_c not in tai.inventory

@pytest.mark.skip
assert item_c in jesse.inventory
assert item_d in jesse.inventory
assert item_e in jesse.inventory
assert item_f not in jesse.inventory

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

Comment on lines +207 to +215
assert not result
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3
assert item_a in tai.inventory
assert item_b in tai.inventory
assert item_c in tai.inventory
assert item_d in jesse.inventory
assert item_e in jesse.inventory
assert item_f in jesse.inventory

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

Comment on lines +241 to +249
assert not result
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3
assert item_a in tai.inventory
assert item_b in tai.inventory
assert item_c in tai.inventory
assert item_d in jesse.inventory
assert item_e in jesse.inventory
assert item_f in jesse.inventory

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants