Skip to content
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

Ruby - Rediet Medhane #86

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Ruby - Rediet Medhane #86

wants to merge 4 commits into from

Conversation

red-med
Copy link

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

No description provided.

Copy link

@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!

import uuid

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!


def get_category(self):
if isinstance(self, Clothing):

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".

from swap_meet.item import Item

class Clothing(Item):

Choose a reason for hiding this comment

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

Excellent!

from swap_meet.item import Item

class Decor(Item):

Choose a reason for hiding this comment

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

Excellent!

self.length = length

def get_category(self):

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 == []

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]

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]

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

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

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