-
Notifications
You must be signed in to change notification settings - Fork 117
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
C17 whales - Morgan Adkisson #109
base: master
Are you sure you want to change the base?
Conversation
… and changed -is- to == in wave 1 tests
…n but did not work
…+Assert test sections complete
…ions in wave 3 written
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 job!
I left a few style notes but overall everything looks good.
Well done!
for rec in recommendations: | ||
assert rec['genre'] == 'Intrigue' | ||
assert len(recommendations) == 0 |
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.
These assertions are kind of contradictory since the for
loop should never be entered if the list is empty.
for rec in recommendations: | |
assert rec['genre'] == 'Intrigue' | |
assert len(recommendations) == 0 | |
assert len(recommendations) == 0 |
movie_dict = {} | ||
|
||
if title and genre and rating: | ||
movie_dict['title'] = title | ||
movie_dict['genre'] = genre | ||
movie_dict['rating'] = rating | ||
else: | ||
return None | ||
return movie_dict |
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.
I generally find it clearer to return a dictionary literal instead of creating an empty dictionary and modifying it:
movie_dict = {} | |
if title and genre and rating: | |
movie_dict['title'] = title | |
movie_dict['genre'] = genre | |
movie_dict['rating'] = rating | |
else: | |
return None | |
return movie_dict | |
if title and genre and rating: | |
return { | |
'title': title, | |
'genre': genre, | |
'rating': rating | |
} | |
else: | |
return None |
for movie_dicts in user_data['watchlist']: | ||
if movie_dicts['title'] == movie: | ||
user_data['watched'].append(movie_dicts) | ||
user_data['watchlist'].remove(movie_dicts) |
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.
Style: movie_dicts
is only a single dict so shouldn't have a plural name:
for movie_dicts in user_data['watchlist']: | |
if movie_dicts['title'] == movie: | |
user_data['watched'].append(movie_dicts) | |
user_data['watchlist'].remove(movie_dicts) | |
for movie_dict in user_data['watchlist']: | |
if movie_dict['title'] == movie: | |
user_data['watched'].append(movie_dict) | |
user_data['watchlist'].remove(movie_dict) | |
No description provided.