Skip to content

Sphinx - Leidy Martinez & Aleida Vieyra #14

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 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d91d2e6
Test passed in create_movie func wave 1
Leidy-Martinez Sep 23, 2024
b4131d0
Co-authored-by: Aleida Vieyra <[email protected]>
Leidy-Martinez Sep 23, 2024
6ba5268
first commit by Aleida, creating function add_to_watched(user_data, m…
aleidavi Sep 23, 2024
246af3b
implementation of wave 01 add_to_watched(user_data, movie) function
aleidavi Sep 23, 2024
eb7fc0a
implemented watch_movie(user_data, title) in party.py, AND completed …
aleidavi Sep 23, 2024
869c613
#Create a copy of user_data in each func
Leidy-Martinez Sep 24, 2024
0a1f6f7
"Finish wave 2, all test passed"
Leidy-Martinez Sep 24, 2024
a8360cb
pushing changes to Wave 3 and 4, coauthored with Leidy Martinez
aleidavi Sep 25, 2024
109b4a0
Fixed test assertion wave1 for correct movie added to watchlist
Leidy-Martinez Sep 26, 2024
5273872
Modified wave4 for efficiency and added changes we made in wave 5
Leidy-Martinez Sep 26, 2024
1733e48
updates from September 25th, 2024, Wave 4 and 5
aleidavi Sep 26, 2024
b25d70d
Co-authored-by: Leidy-Martinez <[email protected]>
aleidavi Sep 26, 2024
ab241c3
removing unused list from wave 4
aleidavi Sep 26, 2024
0c63597
Deleted lines 9-14 in create_movie since we have clean data
Leidy-Martinez Sep 26, 2024
62c4a9b
Merge branch 'main' of https://github.com/Leidy-Martinez/viewing-party
Leidy-Martinez Sep 26, 2024
2ee1e5e
Add comments lines
Leidy-Martinez Sep 26, 2024
a20419a
Reorganize completed tests
Leidy-Martinez Sep 26, 2024
7ed36d1
debugging for wave 5 functions, will create pull request after this.
aleidavi Sep 27, 2024
a69b664
Pulling the remote repository changes made with all tests passed. Mer…
aleidavi Sep 27, 2024
e096bae
condensed lines 131-132 into list comprehension on line 127 - for fun…
aleidavi Sep 27, 2024
aa5a27e
Final! No relevant changes made
Leidy-Martinez Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ When our test failures leave us confused and stuck, let's use the detailed proje
- add the `movie` to the `"watched"` list inside of `user_data`
- return the `user_data`

3. Create a function named `add_to_watchlist`. This function should...
**3. Create a function named `add_to_watchlist`. This function should...

- take two parameters: `user_data`, `movie`
- the value of `user_data` will be a dictionary with a key `"watchlist"`, and a value which is a list of dictionaries representing the movies the user wants to watch
Expand Down
32 changes: 19 additions & 13 deletions tests/test_wave_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
#@pytest.mark.skip()
def test_create_successful_movie():
# Arrange
movie_title = MOVIE_TITLE_1
Expand All @@ -19,7 +19,7 @@ def test_create_successful_movie():
assert new_movie["genre"] == GENRE_1
assert new_movie["rating"] == pytest.approx(RATING_1)

@pytest.mark.skip()
#@pytest.mark.skip()
def test_create_no_title_movie():
# Arrange
movie_title = None
Expand All @@ -32,7 +32,7 @@ def test_create_no_title_movie():
# Assert
assert new_movie is None

@pytest.mark.skip()
# @pytest.mark.skip()
def test_create_no_genre_movie():
# Arrange
movie_title = "Title A"
Expand All @@ -45,7 +45,7 @@ def test_create_no_genre_movie():
# Assert
assert new_movie is None

@pytest.mark.skip()
# @pytest.mark.skip()
def test_create_no_rating_movie():
# Arrange
movie_title = "Title A"
Expand All @@ -58,7 +58,7 @@ def test_create_no_rating_movie():
# Assert
assert new_movie is None

@pytest.mark.skip()
# @pytest.mark.skip()
def test_adds_movie_to_user_watched():
# Arrange
movie = {
Expand All @@ -79,7 +79,7 @@ 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()
# @pytest.mark.skip()
def test_adds_movie_to_non_empty_user_watched():
# Arrange
movie = {
Expand All @@ -99,7 +99,7 @@ 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()
# @pytest.mark.skip()
def test_adds_movie_to_user_watchlist():
# Arrange
movie = {
Expand All @@ -120,7 +120,7 @@ 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()
# @pytest.mark.skip()
def test_adds_movie_to_non_empty_user_watchlist():
# Arrange
movie = {
Expand All @@ -140,7 +140,7 @@ 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()
# @pytest.mark.skip()
def test_moves_movie_from_watchlist_to_empty_watched():
# Arrange
janes_data = {
Expand All @@ -159,12 +159,13 @@ def test_moves_movie_from_watchlist_to_empty_watched():
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 updated_data["watched"][0]["title"] == MOVIE_TITLE_1

Choose a reason for hiding this comment

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

⭐️

# *******************************************************************************************

@pytest.mark.skip()
# @pytest.mark.skip()
def test_moves_movie_from_watchlist_to_watched():
# Arrange
movie_to_watch = HORROR_1
Expand All @@ -183,12 +184,17 @@ 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" **********
janes_data = {
"watchlist": [FANTASY_1],
"watched": [FANTASY_2, movie_to_watch]
}
assert updated_data == janes_data
Comment on lines +190 to +194

Choose a reason for hiding this comment

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

Only suggestion I have here is to change name to something else like expected. Also see my note below about making copies of the originals.

# *******************************************************************************************

@pytest.mark.skip()
# @pytest.mark.skip()
def test_does_nothing_if_movie_not_in_watchlist():
# Arrange
movie_to_watch = HORROR_1
Expand Down
10 changes: 5 additions & 5 deletions tests/test_wave_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
#@pytest.mark.skip()
def test_calculates_watched_average_rating():
# Arrange
janes_data = clean_wave_2_data()
Expand All @@ -14,7 +14,7 @@ def test_calculates_watched_average_rating():
assert average == pytest.approx(3.58333)
assert janes_data == clean_wave_2_data()

@pytest.mark.skip()
#@pytest.mark.skip()
def test_empty_watched_average_rating_is_zero():
# Arrange
janes_data = {
Expand All @@ -27,7 +27,7 @@ def test_empty_watched_average_rating_is_zero():
# Assert
assert average == pytest.approx(0.0)

@pytest.mark.skip()
#@pytest.mark.skip()
def test_most_watched_genre():
# Arrange
janes_data = clean_wave_2_data()
Expand All @@ -39,7 +39,7 @@ def test_most_watched_genre():
assert popular_genre == "Fantasy"
assert janes_data == clean_wave_2_data()

@pytest.mark.skip()
#@pytest.mark.skip()
def test_most_watched_genre_order_mixed():
# Arrange
janes_data = clean_wave_2b_data()
Expand All @@ -51,7 +51,7 @@ def test_most_watched_genre_order_mixed():
assert popular_genre == "Fantasy"
assert janes_data == clean_wave_2b_data()

@pytest.mark.skip()
#@pytest.mark.skip()
def test_genre_is_None_if_empty_watched():
# Arrange
janes_data = {
Expand Down
14 changes: 8 additions & 6 deletions tests/test_wave_03.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
# @pytest.mark.skip()
def test_my_unique_movies():
# Arrange
amandas_data = clean_wave_3_data()
Expand All @@ -16,7 +16,7 @@ def test_my_unique_movies():
assert INTRIGUE_2 in amandas_unique_movies
assert amandas_data == clean_wave_3_data()

@pytest.mark.skip()
# @pytest.mark.skip()
def test_my_not_unique_movies():
# Arrange
amandas_data = clean_wave_3_data()
Expand All @@ -28,7 +28,7 @@ def test_my_not_unique_movies():
# Assert
assert len(amandas_unique_movies) == 0

@pytest.mark.skip()
# @pytest.mark.skip()
def test_friends_unique_movies():
# Arrange
amandas_data = clean_wave_3_data()
Expand All @@ -43,7 +43,7 @@ def test_friends_unique_movies():
assert FANTASY_4 in friends_unique_movies
assert amandas_data == clean_wave_3_data()

@pytest.mark.skip()
# @pytest.mark.skip()
def test_friends_unique_movies_not_duplicated():
# Arrange
amandas_data = clean_wave_3_data()
Expand All @@ -55,12 +55,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 friends_unique_movies == [FANTASY_4, HORROR_1, INTRIGUE_3]
assert amandas_data["watched"] not in friends_unique_movies

Choose a reason for hiding this comment

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

So, this assert statement here is checking if the entire list of watched movies is a single element inside of friends_unique_movies. How could we change this to check if the individual movies are inside of friends_unique_watched?

# **************************************************************************************************

@pytest.mark.skip()
# @pytest.mark.skip()
def test_friends_not_unique_movies():
# Arrange
amandas_data = {
Expand Down
7 changes: 3 additions & 4 deletions tests/test_wave_04.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
# @pytest.mark.skip()
def test_get_available_friend_rec():
# Arrange
amandas_data = clean_wave_4_data()
Expand All @@ -16,8 +16,7 @@ def test_get_available_friend_rec():
assert FANTASY_4b in recommendations
assert amandas_data == clean_wave_4_data()

@pytest.mark.skip()
def test_no_available_friend_recs():
# def test_no_available_friend_recs():
# Arrange
amandas_data = {
"subscriptions": ["hulu", "disney+"],
Expand All @@ -38,7 +37,7 @@ def test_no_available_friend_recs():
# Assert
assert len(recommendations) == 0

@pytest.mark.skip()
# @pytest.mark.skip()
def test_no_available_friend_recs_watched_all():
# Arrange
amandas_data = {
Expand Down
19 changes: 12 additions & 7 deletions tests/test_wave_05.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
#pytest.mark.skip()
def test_new_genre_rec():
# Arrange
sonyas_data = clean_wave_5_data()
Expand All @@ -17,7 +17,7 @@ def test_new_genre_rec():
assert FANTASY_4b in recommendations
assert sonyas_data == clean_wave_5_data()

@pytest.mark.skip()
#pytest.mark.skip()
def test_new_genre_rec_from_empty_watched():
# Arrange
sonyas_data = {
Expand All @@ -38,7 +38,7 @@ def test_new_genre_rec_from_empty_watched():
# Assert
assert len(recommendations) == 0

@pytest.mark.skip()
#pytest.mark.skip()
def test_new_genre_rec_from_empty_friends():
# Arrange
sonyas_data = {
Expand All @@ -52,13 +52,18 @@ def test_new_genre_rec_from_empty_friends():
}
]
}

#Act
genre_recommendations = get_new_rec_by_genre(sonyas_data)

raise Exception("Test needs to be completed.")
#Assert
#raise Exception("Test needs to be completed.")
# *********************************************************************
# ****** Complete the Act and Assert Portions of these tests **********
assert len(genre_recommendations) == 0

Choose a reason for hiding this comment

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

What if we did assert len(genre_recommendations) == []? This more readily declares that the genre_recommendations should be an empty list. Also for testing, if someone returned, say an empty string, this test would technically pass.

# *********************************************************************

@pytest.mark.skip()
#pytest.mark.skip()
def test_unique_rec_from_favorites():
# Arrange
sonyas_data = clean_wave_5_data()
Expand All @@ -72,7 +77,7 @@ def test_unique_rec_from_favorites():
assert INTRIGUE_2b in recommendations
assert sonyas_data == clean_wave_5_data()

@pytest.mark.skip()
#pytest.mark.skip()
def test_unique_from_empty_favorites():
# Arrange
sonyas_data = {
Expand All @@ -94,7 +99,7 @@ def test_unique_from_empty_favorites():
# Assert
assert len(recommendations) == 0

@pytest.mark.skip()
#pytest.mark.skip()
def test_new_rec_from_empty_friends():
# Arrange
sonyas_data = {
Expand Down
Loading