-
Notifications
You must be signed in to change notification settings - Fork 590
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
Kate - Lion #20
base: main
Are you sure you want to change the base?
Kate - Lion #20
Conversation
There was a problem hiding this 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 was good overall. There are a few places where it could have been simpler/cleaner and there was a small logical error in one of the functions. See comments below.
For commits, it would be great if the commit messages could be more descriptive. Instead of writing which wave you completed, it would be good to see something like "Created Item class" or "Added swap_item function".
|
||
class Clothing(Item): | ||
def __init__(self, category = "Clothing", condition = 0.0, age = None): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
pass | ||
from swap_meet.item import Item | ||
|
||
class Electronics(Item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
} | ||
|
||
return rating_description[self.condition] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! So clean and simple! =D
|
||
def condition_description(self): | ||
rating_description = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a good idea to have this dictionary outside of the function so that it doesn't have to be recreated every time the function is called.
assert result == True | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert all(item in [item_f, item_a, item_b] for item in tai.inventory) | ||
assert all(item in [item_d, item_e, item_c] for item in jesse.inventory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
assert tai.inventory == [item_a, item_b, item_c] | ||
assert jesse.inventory == [item_d, item_e, item_f] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better for these that you use a similar assert to what you did for the other tests. ==
will fail if the two lists are not in the same order but contain the same elements.
assert result == False | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert tai.inventory == [item_c, item_b, item_a] | ||
assert jesse.inventory == [item_f, item_e, item_d] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
from swap_meet.electronics import Electronics | ||
|
||
''' | ||
**** TEST ADDED FOR [OPTIONAL] SWAP BY NEWEST FUNCTION *** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! The tests look great!
return newest_item | ||
|
||
def swap_by_newest(self, another_vendor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent job taking on the extra work!
No description provided.