Open
Conversation
… and changed -is- to == in wave 1 tests
…n but did not work
…+Assert test sections complete
…ions in wave 3 written
kaidamasaki
reviewed
Mar 31, 2022
kaidamasaki
left a comment
There was a problem hiding this comment.
Great job!
I left a few style notes but overall everything looks good.
Well done!
Comment on lines
+59
to
+61
| for rec in recommendations: | ||
| assert rec['genre'] == 'Intrigue' | ||
| assert len(recommendations) == 0 |
There was a problem hiding this comment.
These assertions are kind of contradictory since the for loop should never be entered if the list is empty.
Suggested change
| for rec in recommendations: | |
| assert rec['genre'] == 'Intrigue' | |
| assert len(recommendations) == 0 | |
| assert len(recommendations) == 0 |
Comment on lines
+8
to
+16
| 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.
I generally find it clearer to return a dictionary literal instead of creating an empty dictionary and modifying it:
Suggested change
| 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 |
Comment on lines
+27
to
+30
| 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.
Style: movie_dicts is only a single dict so shouldn't have a plural name:
Suggested change
| 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) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.