Skip to content

Ruby - Rediet Medhane#86

Open
red-med wants to merge 4 commits intoAda-C19:mainfrom
red-med:main
Open

Ruby - Rediet Medhane#86
red-med wants to merge 4 commits intoAda-C19:mainfrom
red-med:main

Conversation

@red-med
Copy link
Copy Markdown

@red-med red-med commented Apr 7, 2023

No description provided.

Copy link
Copy Markdown

@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! There are some comments below on places to make the code cleaner/simpler. It would be great to see commits added more often!

Comment thread swap_meet/clothing.py
@@ -1,2 +1,18 @@
class Clothing:
pass No newline at end of file
import uuid
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's not necessary to import uuid here since it's not used in this class!

Comment thread swap_meet/clothing.py
self.fabric = fabric

def get_category(self):
if isinstance(self, 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 check is not necessary since only Clothing instances can call this method. You can just return "Clothing".

Comment thread swap_meet/clothing.py
import uuid
from swap_meet.item import Item

class Clothing(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/decor.py
import uuid
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/decor.py
self.width = width
self.length = length

def get_category(self):
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 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 == []
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 +114 to +115
assert tai.inventory == [item_a, item_b, item_f]
assert jesse.inventory == [item_d, item_e, item_c]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment on lines +149 to +156
# 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]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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!

Comment on lines +239 to +247
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
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 +278 to +286
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
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