-
Notifications
You must be signed in to change notification settings - Fork 28
C22 Phoenix - Dana Delgado and Jen Nguyen #8
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?
Changes from all commits
367a959
7300b8a
4892b3b
a4fb004
4827d8c
313a029
7dc340b
0ca440c
3f9d211
dced637
b7db3cd
39fc8b9
9ad3fd0
3079799
927a7e5
2a1b38c
72eab81
90f53e7
d522e3a
06bf46f
7b2f173
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ | |
| from viewing_party.party import * | ||
| from tests.test_constants import * | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_create_successful_movie(): | ||
| # Arrange | ||
| movie_title = MOVIE_TITLE_1 | ||
|
|
@@ -19,7 +18,6 @@ def test_create_successful_movie(): | |
| assert new_movie["genre"] == GENRE_1 | ||
| assert new_movie["rating"] == pytest.approx(RATING_1) | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_create_no_title_movie(): | ||
| # Arrange | ||
| movie_title = None | ||
|
|
@@ -32,7 +30,6 @@ def test_create_no_title_movie(): | |
| # Assert | ||
| assert new_movie is None | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_create_no_genre_movie(): | ||
| # Arrange | ||
| movie_title = "Title A" | ||
|
|
@@ -45,7 +42,6 @@ def test_create_no_genre_movie(): | |
| # Assert | ||
| assert new_movie is None | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_create_no_rating_movie(): | ||
| # Arrange | ||
| movie_title = "Title A" | ||
|
|
@@ -58,7 +54,6 @@ def test_create_no_rating_movie(): | |
| # Assert | ||
| assert new_movie is None | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_adds_movie_to_user_watched(): | ||
| # Arrange | ||
| movie = { | ||
|
|
@@ -79,7 +74,6 @@ def test_adds_movie_to_user_watched(): | |
| assert updated_data["watched"][0]["genre"] == GENRE_1 | ||
| assert updated_data["watched"][0]["rating"] == RATING_1 | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_adds_movie_to_non_empty_user_watched(): | ||
| # Arrange | ||
| movie = { | ||
|
|
@@ -99,7 +93,6 @@ def test_adds_movie_to_non_empty_user_watched(): | |
| assert movie in updated_data["watched"] | ||
| assert FANTASY_2 in updated_data["watched"] | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_adds_movie_to_user_watchlist(): | ||
| # Arrange | ||
| movie = { | ||
|
|
@@ -120,7 +113,6 @@ def test_adds_movie_to_user_watchlist(): | |
| assert updated_data["watchlist"][0]["genre"] == GENRE_1 | ||
| assert updated_data["watchlist"][0]["rating"] == RATING_1 | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_adds_movie_to_non_empty_user_watchlist(): | ||
| # Arrange | ||
| movie = { | ||
|
|
@@ -140,7 +132,6 @@ def test_adds_movie_to_non_empty_user_watchlist(): | |
| assert movie in updated_data["watchlist"] | ||
| assert FANTASY_2 in updated_data["watchlist"] | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_moves_movie_from_watchlist_to_empty_watched(): | ||
| # Arrange | ||
| janes_data = { | ||
|
|
@@ -158,13 +149,15 @@ def test_moves_movie_from_watchlist_to_empty_watched(): | |
| # Assert | ||
| assert len(updated_data["watchlist"]) == 0 | ||
| assert len(updated_data["watched"]) == 1 | ||
|
|
||
| raise Exception("Test needs to be completed.") | ||
| # raise Exception("Test needs to be completed.") | ||
| # ******************************************************************************************* | ||
| # ****** Add assertions here to test that the correct movie was added to "watched" ********** | ||
| # ******************************************************************************************* | ||
| assert MOVIE_TITLE_1 not in updated_data["watchlist"] | ||
| assert updated_data["watched"][0]["title"] == MOVIE_TITLE_1 | ||
| assert updated_data["watched"][0]["genre"] == GENRE_1 | ||
| assert updated_data["watched"][0]["rating"] == RATING_1 | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_moves_movie_from_watchlist_to_watched(): | ||
| # Arrange | ||
| movie_to_watch = HORROR_1 | ||
|
|
@@ -183,12 +176,13 @@ def test_moves_movie_from_watchlist_to_watched(): | |
| assert len(updated_data["watchlist"]) == 1 | ||
| assert len(updated_data["watched"]) == 2 | ||
|
|
||
| raise Exception("Test needs to be completed.") | ||
| # raise Exception("Test needs to be completed.") | ||
| # ******************************************************************************************* | ||
| # ****** Add assertions here to test that the correct movie was added to "watched" ********** | ||
| # ******************************************************************************************* | ||
| assert movie_to_watch not in updated_data["watchlist"] | ||
| assert movie_to_watch in updated_data["watched"] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These look great too! |
||
|
|
||
| @pytest.mark.skip() | ||
| def test_does_nothing_if_movie_not_in_watchlist(): | ||
| # Arrange | ||
| movie_to_watch = HORROR_1 | ||
|
|
@@ -205,3 +199,19 @@ def test_does_nothing_if_movie_not_in_watchlist(): | |
| assert len(updated_data["watched"]) == 1 | ||
| assert movie_to_watch not in updated_data["watchlist"] | ||
| assert movie_to_watch not in updated_data["watched"] | ||
|
|
||
| def test_no_movie_input(): | ||
| # Arrange | ||
| movie = None | ||
| user_data = { | ||
| "watched": [], | ||
| "watchlist": [] | ||
| } | ||
|
|
||
| # Act | ||
| updated_data = add_to_watched(user_data, movie) | ||
| updated_data = add_to_watchlist(user_data, movie) | ||
|
|
||
| # Assert | ||
| assert len(updated_data["watched"]) == 0 | ||
| assert len(updated_data["watchlist"]) == 0 | ||
|
Comment on lines
+203
to
+217
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love this additional test! Always feel free to add tests that our test suite might cover! My one suggestion here is to work on the name of your test! |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| from viewing_party.party import * | ||
| from tests.test_constants import * | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_my_unique_movies(): | ||
| # Arrange | ||
| amandas_data = clean_wave_3_data() | ||
|
|
@@ -16,7 +15,6 @@ def test_my_unique_movies(): | |
| assert INTRIGUE_2 in amandas_unique_movies | ||
| assert amandas_data == clean_wave_3_data() | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_my_not_unique_movies(): | ||
| # Arrange | ||
| amandas_data = clean_wave_3_data() | ||
|
|
@@ -28,7 +26,6 @@ def test_my_not_unique_movies(): | |
| # Assert | ||
| assert len(amandas_unique_movies) == 0 | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_friends_unique_movies(): | ||
| # Arrange | ||
| amandas_data = clean_wave_3_data() | ||
|
|
@@ -43,7 +40,6 @@ def test_friends_unique_movies(): | |
| assert FANTASY_4 in friends_unique_movies | ||
| assert amandas_data == clean_wave_3_data() | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_friends_unique_movies_not_duplicated(): | ||
| # Arrange | ||
| amandas_data = clean_wave_3_data() | ||
|
|
@@ -55,12 +51,14 @@ def test_friends_unique_movies_not_duplicated(): | |
| # Assert | ||
| assert len(friends_unique_movies) == 3 | ||
|
|
||
| raise Exception("Test needs to be completed.") | ||
| # raise Exception("Test needs to be completed.") | ||
| # ************************************************************************************************* | ||
| # ****** Add assertions here to test that the correct movies are in friends_unique_movies ********** | ||
| # ************************************************************************************************** | ||
| assert FANTASY_4 in friends_unique_movies | ||
| assert HORROR_1 in friends_unique_movies | ||
| assert INTRIGUE_3 in friends_unique_movies | ||
|
Comment on lines
+58
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks good! One thing I like about what y'all did was you checked for every movie that could be included in the list! I think this was a smart idea as it confirms that there is no duplicate While checking to see if a particular movie is in the resulting output is great, if you don't check everything else like the length and every other movie that should be in there, it's easy for something to slip through the cracks. I wonder if there is a way to simply test and see if the |
||
|
|
||
| @pytest.mark.skip() | ||
| def test_friends_not_unique_movies(): | ||
| # Arrange | ||
| amandas_data = { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| from viewing_party.party import * | ||
| from tests.test_constants import * | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_new_genre_rec(): | ||
| # Arrange | ||
| sonyas_data = clean_wave_5_data() | ||
|
|
@@ -17,7 +16,6 @@ def test_new_genre_rec(): | |
| assert FANTASY_4b in recommendations | ||
| assert sonyas_data == clean_wave_5_data() | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_new_genre_rec_from_empty_watched(): | ||
| # Arrange | ||
| sonyas_data = { | ||
|
|
@@ -38,7 +36,6 @@ def test_new_genre_rec_from_empty_watched(): | |
| # Assert | ||
| assert len(recommendations) == 0 | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_new_genre_rec_from_empty_friends(): | ||
| # Arrange | ||
| sonyas_data = { | ||
|
|
@@ -53,12 +50,16 @@ def test_new_genre_rec_from_empty_friends(): | |
| ] | ||
| } | ||
|
|
||
| raise Exception("Test needs to be completed.") | ||
| # raise Exception("Test needs to be completed.") | ||
| # ********************************************************************* | ||
| # ****** Complete the Act and Assert Portions of these tests ********** | ||
| # ********************************************************************* | ||
| # Act | ||
| recommendations = get_new_rec_by_genre(sonyas_data) | ||
|
|
||
| # Assert | ||
| assert len(recommendations) == 0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The act and assert here look good! What other asserts could we check that would achieve a similar purpose? |
||
|
|
||
| @pytest.mark.skip() | ||
| def test_unique_rec_from_favorites(): | ||
| # Arrange | ||
| sonyas_data = clean_wave_5_data() | ||
|
|
@@ -72,7 +73,6 @@ def test_unique_rec_from_favorites(): | |
| assert INTRIGUE_2b in recommendations | ||
| assert sonyas_data == clean_wave_5_data() | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_unique_from_empty_favorites(): | ||
| # Arrange | ||
| sonyas_data = { | ||
|
|
@@ -94,7 +94,6 @@ def test_unique_from_empty_favorites(): | |
| # Assert | ||
| assert len(recommendations) == 0 | ||
|
|
||
| @pytest.mark.skip() | ||
| def test_new_rec_from_empty_friends(): | ||
| # Arrange | ||
| sonyas_data = { | ||
|
|
||
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 look great! Super robust and cover all the things that might need to be covered!