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

Sapphire - Anna Lima #65

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f2793f4
modified readme file to add agreements
Mar 27, 2023
2168192
added function names for wave1 with pass statements for each
annavanwesep Mar 27, 2023
a3df68c
wave 01 function 01
Mar 27, 2023
e721b55
not skipping wave 1 tests
annavanwesep Mar 27, 2023
fa443bf
conflicts resolved
annavanwesep Mar 27, 2023
ddce7ed
wave 01 second function
Mar 27, 2023
4974639
Merge branch 'main' of https://github.com/annavanwesep/viewing-party
Mar 27, 2023
c64dedc
create_movie function passes tests and outputs dictionary
annavanwesep Mar 28, 2023
8eb5559
added watch_movie function to wave_01 - passing 7 tests
annavanwesep Mar 28, 2023
1930e43
not sure but terminal says to
Mar 28, 2023
387fb5f
wave 01 3/4 complete
Mar 28, 2023
f19b8da
function 3 complete?
Mar 28, 2023
ef5776d
added indexing statements for watch_movie
annavanwesep Mar 28, 2023
a914a33
added wave02 function skeletons with parameters and doc strings for i…
annavanwesep Mar 28, 2023
520d017
added assert statement to testwave01
annavanwesep Mar 28, 2023
54ba447
10 passed tests
Mar 28, 2023
35f3b8f
wave 01 success
Mar 29, 2023
c71847f
added 2 passing functions for wave02, passing all tests
annavanwesep Mar 29, 2023
6c5ce9c
add docstring and functions for wave03
annavanwesep Mar 29, 2023
d1fcbd2
wave 3 first attempt
Mar 29, 2023
3df11a8
fixed 1 function in wave1 for correct indexing and syntax
annavanwesep Mar 29, 2023
37b443e
wave 03 function 01
Mar 29, 2023
a698b80
added second function to wave03 passes tests
annavanwesep Mar 30, 2023
e4cf718
added assert statements to wave03 tests, functions still passing
annavanwesep Mar 30, 2023
6ec49ac
wave 4 2/3 pass
Mar 30, 2023
616c83f
refactored wave04 function to remove duplicate movies from rec, passi…
annavanwesep Mar 30, 2023
7327bb8
first iteration of wave05 with first function passing 1 test
annavanwesep Mar 30, 2023
648bcf6
first function of wave05 passing 2 tests
annavanwesep Mar 30, 2023
435c1d9
Last wave all but last function done
Mar 30, 2023
85d9e75
wave 05 5/7 pass
Mar 30, 2023
ba6bea4
woo its over
Mar 31, 2023
1eb0ed8
cleaned up docstrings and spacing, all functions passing all tests in…
annavanwesep Mar 31, 2023
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
Prev Previous commit
Next Next commit
wave 01 success
git commit -m 'wave 01 success!'
q

exit
/
  • Loading branch information
Edith committed Mar 29, 2023
commit 35f3b8f273e1e1c26fbcc91b1e1649550ccd8bd9
7 changes: 4 additions & 3 deletions tests/test_wave_01.py
Original file line number Diff line number Diff line change
@@ -164,8 +164,8 @@ def test_moves_movie_from_watchlist_to_empty_watched():
# *******************************************************************************************
# ****** Add assertions here to test that the correct movie was added to "watched" **********
# *******************************************************************************************
assert updated_data["watchlist"] == None
assert updated_data["watched"] == [MOVIE_TITLE_1]
assert updated_data["watched"] == [{ "title": MOVIE_TITLE_1, "genre": GENRE_1,
"rating": RATING_1 }]

#@pytest.mark.skip() - failing - need to add assertions
def test_moves_movie_from_watchlist_to_watched():
@@ -191,7 +191,8 @@ def test_moves_movie_from_watchlist_to_watched():
# ****** Add assertions here to test that the correct movie was added to "watched" **********
# *******************************************************************************************
assert updated_data["watchlist"] == [FANTASY_1]
assert updated_data["watched"] == [movie_to_watch, FANTASY_2]
assert updated_data["watched"] == [FANTASY_2, movie_to_watch]
# order matters ie FANTASY_2, movie_to_watch

#@pytest.mark.skip() #passing
def test_does_nothing_if_movie_not_in_watchlist():
47 changes: 41 additions & 6 deletions viewing_party/party.py
Original file line number Diff line number Diff line change
@@ -49,13 +49,48 @@ def watch_movie(user_data, title):
title is a string representing the title of the movie the user has watched
output: user_data
'''
if not title in user_data:
return user_data
# if not title in user_data:
# return user_data
# value user_data dictionary with "watchlist"
user_watchlist_movies = user_data["watchlist"]
# value user_data dictionary with "watched"
watched_movies = user_data["watched"]
# this represents the title of the movie the user has watched
for watchlist_dict in user_watchlist_movies:
# if this title is in the users watchlist
# is title = title of watch_dict
if title == watchlist_dict['title']:
user_watchlist_movies.remove(watchlist_dict)
watched_movies.append(watchlist_dict)
return user_data

# value of key called title

# If the title is in a movie in the user's watchlist:
# remove that movie from the watchlist
# add that movie to watched
# return the user_data

#Note: For Waves 2, 3, 4, and 5, your implementation of each of the functions
# should not modify user_data. .copy() or .deepcopy() possibly



# for watched_title in watched_movies:
#
# # if the title is in the movie watchlist remove from the watchlist
#







if title in user_data:
user_data.remove(title['watchlist'])
user_data.append(title['watched'])
return user_data
# if title in user_data:
# user_data.remove(title['watchlist'])
# user_data.append(title['watched'])
# return user_data


# -----------------------------------------