Skip to content
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

C22 Sunitha Nela and Izzy Hirad #15

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
start watch_movie
izzycommits committed Sep 23, 2024
commit 0fc3206c0f1ccca1c1c9e3a3cf622e36daac9246
8 changes: 4 additions & 4 deletions tests/test_wave_01.py
Original file line number Diff line number Diff line change
@@ -80,7 +80,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 = {
@@ -100,7 +100,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 = {
@@ -121,7 +121,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 = {
@@ -141,7 +141,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 = {
46 changes: 46 additions & 0 deletions viewing_party/party.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
# ------------- WAVE 1 --------------------

def create_movie(title, genre, rating):
@@ -18,6 +19,51 @@ def add_to_watched(user_data, movie):

return user_data

def add_to_watchlist(user_data, movie):
user_data["watchlist"].append(movie)

# for data in user_data.keys():
# user_data[data].append(movie)

return user_data

def watch_movie(user_data, title):
temp_user_data = copy.deepcopy(user_data)
watch_list = temp_user_data["watchlist"]
watched = temp_user_data["watched"]

# for i in range(0, len(watch_list)):
# watch_list_title = watch_list[i]["title"]
# # if watch_list_title == title:
# removed_movie = watch_list[i].remove()
# print("rm", removed_movie)



# return

#watched_movie = user_data["watchlist"]
# loop through list /access key to compare title
#remove watched_movie.pop()
#append to user


janes_data = {
"watchlist": [{
"title": "MOVIE_TITLE_1",
"genre": "GENRE_1",
"rating": "RATING_1"
},{
"title": "MOVIE_TITLE_2",
"genre": "GENRE_1",
"rating": "RATING_1"
}],

"watched": []
}

updated_data = watch_movie(janes_data, "MOVIE_TITLE_1")

# -----------------------------------------
# ------------- WAVE 2 --------------------
# -----------------------------------------