-
Notifications
You must be signed in to change notification settings - Fork 20
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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!
There was a problem hiding this 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) |
There was a problem hiding this comment.
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
)
name = request_body["name"] | ||
description = request_body["description"] | ||
number_moons = request_body["number_moons"] | ||
color = request_body["color"] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query=query.order_by(Planet.id) | |
query = query.order_by(Planet.id) |
planet.name = request_body["name"] | ||
planet.description = request_body["description"] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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):
No description provided.