Skip to content

Commit

Permalink
fixed second function in wave3, adding notes written for wave 4
Browse files Browse the repository at this point in the history
  • Loading branch information
charliemushishi committed Mar 29, 2023
1 parent 9408fa6 commit 8e3a180
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 13 deletions.
12 changes: 6 additions & 6 deletions play_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
pp = pprint.PrettyPrinter(indent=4)

# play testing section
print("\n-----Wave 01 test data-----")
pp.pprint(HORROR_1)
pp.pprint(FANTASY_1)
pp.pprint(FANTASY_2)
# print("\n-----Wave 01 test data-----")
# pp.pprint(HORROR_1)
# pp.pprint(FANTASY_1)
# pp.pprint(FANTASY_2)

# print("\n-----Wave 02 user_data-----")
# pp.pprint(clean_wave_2_data())

#print("\n-----Wave 03 user_data-----")
#pp.pprint(clean_wave_3_data())
print("\n-----Wave 03 user_data-----")
pp.pprint(clean_wave_3_data())

# Wave 04 user data
#print("\n-----Wave 04 user_data-----")
Expand Down
12 changes: 9 additions & 3 deletions tests/test_wave_03.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from tests.test_constants import *


@pytest.mark.skip()
def test_my_unique_movies():
# Arrange
amandas_data = clean_wave_3_data()
Expand All @@ -16,6 +17,7 @@ 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
Expand All @@ -28,7 +30,7 @@ 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()
Expand All @@ -43,7 +45,7 @@ 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()
Expand All @@ -54,7 +56,11 @@ def test_friends_unique_movies_not_duplicated():

# Assert
assert len(friends_unique_movies) == 3

assert FANTASY_4 in friends_unique_movies
assert HORROR_1 in friends_unique_movies
assert INTRIGUE_3 in friends_unique_movies


#raise Exception("Test needs to be completed.")
# *************************************************************************************************
# ****** Add assertions here to test that the correct movies are in friends_unique_movies **********
Expand Down
81 changes: 77 additions & 4 deletions viewing_party/party.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,85 @@ def get_most_watched_genre(user_data):
# }


#wave 3
#function 2


def get_friends_unique_watched(user_data):

user_watched = set([movie["title"] for movie in user_data["watched"]])
friends_list = []

for friend in user_data["friends"]:
for movie in friend["watched"]:
if movie["title"] not in user_watched and movie not in friends_list:
friends_list.append(movie)

return friends_list

"""
does not remove duplicates
user = user_data["watched"]
friends = user_data["friends"]
friends_list = []
#i = watched
for i_dict in friends:
movies_list = i_dict["watched"]
for movies_dict in movies_list:
if movies_dict not in user:
friends_list.append(movies_dict)
if key,value in friends_list["title"]
return friends_list
"""


#wave 4
#function 1

# def get_available_recs(user_data):
# """
# takes 1 parameter user_data
# user_data field subcscriptions
# value of subscriptions is list of string
# represents the names of ea streaming service user has access
# ea friend in friends has watched list
# ea movie in watched list has host
# host is string that says what streaming service is hosted on
# determine list of recs nmovies
# movie should be added to list only if
# user has not watched
# atleast one user friend has watched
# host of movie is service thats in users subscription
# return list of rec movies
# """
# amandas_data = {
# "subscriptions": ["hulu", "disney+"],
# "watched": [],
# "friends": [
# {
# "watched": [HORROR_1b]
# },
# {
# "watched": [FANTASY_3b]
# }
# ]
# }
# #subscription ['netflix','hulu','crunchyroll']
# friends = [friend:[movie : "host"(watched list)]]
# list_of_rec_movies = []

# users_subscriptions = user_data[0]
# #[friends][0][watched]
# movies add to list if
# user has not watched
# one friend has watched
# host is a service users owns
# return list_of_rec_movies


# -----------------------------------------
# ------------- WAVE 3 --------------------
# -----------------------------------------


# -----------------------------------------
# ------------- WAVE 4 --------------------
# -----------------------------------------
Expand Down

0 comments on commit 8e3a180

Please sign in to comment.