Skip to content

C22 Izzy Hirad, Christelle Nkera , Marjana Khatun #13

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

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

Conversation

marjanak
Copy link

No description provided.

Copy link

@kelsey-steven-ada kelsey-steven-ada left a comment

Choose a reason for hiding this comment

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

Great work so far y'all!

Copy link

@kelsey-steven-ada kelsey-steven-ada left a comment

Choose a reason for hiding this comment

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

Great work y'all! I left a couple suggestions of things to take forward for future projects.

I like seeing that your team was making commits as you went, in the future I would like to see folks practicing writing more detailed commit messages that talk about the specific files changed, routes added, etc. (closer to the last couple commit messages that included some information on what changed in the commit).

number_moons = request_body["number_moons"]
color = request_body["color"]

new_planet = Planet(name=name, description=description,number_moons=number_moons,color=color)

Choose a reason for hiding this comment

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

Another way to break this line up for length and readability could be:

new_planet = Planet(
    name=name, 
    description=description,
    number_moons=number_moons,
    color=color
)

Comment on lines +10 to +13
name = request_body["name"]
description = request_body["description"]
number_moons = request_body["number_moons"]
color = request_body["color"]

Choose a reason for hiding this comment

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

What kind of error could be raised by this code? What's a way we could handle it?

Copy link

Choose a reason for hiding this comment

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

This could raise a KeyError, and we could add a try/except?

if number_moons_param:
query = query.where(Planet.number_moons >= 95 )

query=query.order_by(Planet.id)

Choose a reason for hiding this comment

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

Suggested change
query=query.order_by(Planet.id)
query = query.order_by(Planet.id)

Comment on lines +52 to +53
planet.name = request_body["name"]
planet.description = request_body["description"]

Choose a reason for hiding this comment

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

What other attributes does a Planet model have that we might want to include in a PUT update route?

Copy link

Choose a reason for hiding this comment

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

number_moons = request_body["number_moons"]
color = request_body["color"]


}

def test_planet_not_found(client):

Choose a reason for hiding this comment

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

The name test_planet_not_found is ambiguous, because there are many scenarios across several of our routes where a planet might not be found (trying to delete a planet, trying to update a planet, trying to fetch a planet). The larger our project is, the more important it becomes to include the name of the function we're testing in the test name to make it clear at a glance exactly what our intention is.

def test_get_one_planet_not_found(client):

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.

5 participants