Skip to content

All tests have passed all waves done#89

Open
MoyoMoz wants to merge 1 commit into
Ada-C19:mainfrom
MoyoMoz:main
Open

All tests have passed all waves done#89
MoyoMoz wants to merge 1 commit into
Ada-C19:mainfrom
MoyoMoz:main

Conversation

@MoyoMoz

@MoyoMoz MoyoMoz commented Apr 13, 2023

Copy link
Copy Markdown

this was so mind bending

@nancy-harris nancy-harris left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent job! There are some comments below on places to make the code cleaner/simpler. There are also comments about not making modifications to tests provided by the project.

Make sure to commit more often! You should be doing that at least once per wave.

Comment thread swap_meet/clothing.py
def __init__(self, id=None, fabric="Unknown", condition=0):
super().__init__(id=id, condition=condition)
self.fabric = fabric
self.category = "Clothing"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This attribute is not used anywhere in the class and doesn't seem to be necessary!

Comment thread swap_meet/decor.py
pass No newline at end of file
from swap_meet.item import Item

class Decor(Item):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent!

Comment thread swap_meet/electronics.py
pass
from swap_meet.item import Item

class Electronics(Item):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent!

Comment thread swap_meet/item.py
self.condition = condition
self.category = "Item"

def __eq__(self, other):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What is this method for?

Comment thread swap_meet/item.py

class Item:
pass No newline at end of file
def __init__(self, id=None, condition=0):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent!

Comment on lines +113 to +116
assert item_a not in tai.inventory
assert item_c in tai.inventory
assert item_f not in jesse.inventory
assert item_d in jesse.inventory

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great start! It would also be good to check that the other items we expect in the inventories are there as well.

Comment on lines -91 to +98
item_a = Decor(condition=2.0)
item_a = Decor(condition=5.0)
item_b = Electronics(condition=4.0)
item_c = Decor(condition=4.0)
item_c = Decor(condition=2.0)
tai = Vendor(
inventory=[item_a, item_b, item_c]
)

# them
item_d = Clothing(condition=2.0)
item_e = Decor(condition=4.0)
item_f = Clothing(condition=4.0)
item_f = Clothing(condition=5.0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Again, please do not modify parts of the test that are not meant to be modified.

Comment on lines +141 to +151
assert result
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3
assert item_c not in tai.inventory
assert item_b in tai.inventory
assert item_a in tai.inventory # Updated this line
assert item_f in tai.inventory
assert item_e in jesse.inventory
assert item_d in jesse.inventory # Updated this line
assert item_c in jesse.inventory
assert item_f not in jesse.inventory # Updated this line

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent!

Comment on lines +231 to +239
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent!

Comment on lines +266 to +274
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

Copy link
Copy Markdown

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