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. It would be great to see commits added more often!
| @@ -1,2 +1,18 @@ | |||
| class Clothing: | |||
| pass No newline at end of file | |||
| import uuid | |||
There was a problem hiding this comment.
It's not necessary to import uuid here since it's not used in this class!
| self.fabric = fabric | ||
|
|
||
| def get_category(self): | ||
| if isinstance(self, Clothing): |
There was a problem hiding this comment.
This check is not necessary since only Clothing instances can call this method. You can just return "Clothing".
| import uuid | ||
| from swap_meet.item import Item | ||
|
|
||
| class Clothing(Item): |
| import uuid | ||
| from swap_meet.item import Item | ||
|
|
||
| class Decor(Item): |
| self.width = width | ||
| self.length = length | ||
|
|
||
| def get_category(self): |
There was a problem hiding this comment.
This check is not necessary since only Decor instances can call this method. You can just return "Decor".
| # ********************************************************************* | ||
| # ****** Complete Assert Portion of this test ********** | ||
| # ********************************************************************* | ||
| assert items == [] |
| assert tai.inventory == [item_a, item_b, item_f] | ||
| assert jesse.inventory == [item_d, item_e, item_c] |
There was a problem hiding this comment.
Be careful using == for asserts on lists! It requires that the items be in exactly the same order to be true. It would be safer to use in like the other tests in this file.
| # assert item_a in tai.inventory | ||
| # assert item_b in tai.inventory | ||
| # assert item_f in tai.inventory | ||
| # assert item_d in jesse.inventory | ||
| # assert item_c in jesse.inventory | ||
| # assert item_e in jesse.inventory | ||
| #assert tai.inventory == [item_b, item_a, item_f] | ||
| #assert jesse.inventory == [item_d, item_e, item_c] |
There was a problem hiding this comment.
Looks like you were debating which types of asserts to use and commented them all out! Make sure to check these things before submitting to ensure your tests are doing what you want them to do!
| assert result == False | ||
| 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 |
| assert result == False | ||
| 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 |
No description provided.