All tests have passed all waves done#89
Open
MoyoMoz wants to merge 1 commit into
Open
Conversation
nancy-harris
left a comment
There was a problem hiding this comment.
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.
| def __init__(self, id=None, fabric="Unknown", condition=0): | ||
| super().__init__(id=id, condition=condition) | ||
| self.fabric = fabric | ||
| self.category = "Clothing" |
There was a problem hiding this comment.
This attribute is not used anywhere in the class and doesn't seem to be necessary!
| pass No newline at end of file | ||
| from swap_meet.item import Item | ||
|
|
||
| class Decor(Item): |
| pass | ||
| from swap_meet.item import Item | ||
|
|
||
| class Electronics(Item): |
| self.condition = condition | ||
| self.category = "Item" | ||
|
|
||
| def __eq__(self, other): |
|
|
||
| class Item: | ||
| pass No newline at end of file | ||
| def __init__(self, id=None, condition=0): |
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
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 |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this was so mind bending