forked from AdaGold/viewing-party
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Ocelots - Diana A. #20
Open
diarreola
wants to merge
16
commits into
ada-ac2:master
Choose a base branch
from
diarreola:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4d53f98
Add fixture for wave1
diarreola f4c2b62
Add tests for wave1 add_to_watched func
diarreola 897a6d4
Add wave1 create_movie and add_to_watched
diarreola 44839a0
revert wave1 fixture
diarreola 279a955
Add and update tests for add_to_watchlist func
diarreola 7baddec
Add add_to_watchlist func
diarreola dd41815
Updated wave 1 watch_movie tests
diarreola 263755a
Add watch_movie func
diarreola 71db575
Add wave 2 functions
diarreola 8d38f54
Add wave 3 get_unique_watched func
diarreola eec0982
Wave 3 complete
diarreola d2cfc8f
Update wave3 functions
diarreola c56ac14
Completed wave 4
diarreola d6e1148
Add wave5 function1
diarreola b36fc81
WIP neeed to finish last function, will finish on monday
diarreola 32205da
Complete wave 5
diarreola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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,8 +54,20 @@ def test_create_no_rating_movie(): | |
# Assert | ||
assert new_movie is None | ||
|
||
@pytest.mark.skip() | ||
def test_adds_movie_to_user_watched(): | ||
def test_adds_no_movie_to_user_watched(): | ||
# Arrange | ||
movie = {} | ||
user_data = { | ||
"watched": [] | ||
} | ||
|
||
# Act | ||
updated_data = add_to_watched(user_data, movie) | ||
|
||
# Assert | ||
assert len(updated_data["watched"]) == 0 | ||
|
||
def test_adds_movie_to_empty_user_watched_list(): | ||
# Arrange | ||
movie = { | ||
"title": MOVIE_TITLE_1, | ||
|
@@ -79,8 +87,45 @@ 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_user_watchlist(): | ||
def test_adds_movie_to_user_watched(): | ||
# Arrange | ||
movie = { | ||
"title": MOVIE_TITLE_1, | ||
"genre": GENRE_1, | ||
"rating": RATING_1 | ||
} | ||
movie_watched = { | ||
"title": MOVIE_TITLE_2, | ||
"genre": GENRE_2, | ||
"rating": RATING_2 | ||
} | ||
user_data = { | ||
"watched": [movie_watched] | ||
} | ||
|
||
# Act | ||
updated_data = add_to_watched(user_data, movie) | ||
|
||
# Assert | ||
assert len(updated_data["watched"]) == 2 | ||
assert updated_data["watched"][1]["title"] == MOVIE_TITLE_1 | ||
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. Excellent thoroughness, testing all of the attributes here for completeness |
||
assert updated_data["watched"][1]["genre"] == GENRE_1 | ||
assert updated_data["watched"][1]["rating"] == RATING_1 | ||
|
||
def test_adds_no_movie_to_user_watchlist(): | ||
# Arrange | ||
movie = {} | ||
user_data = { | ||
"watchlist": [] | ||
} | ||
|
||
# Act | ||
updated_data = add_to_watchlist(user_data, movie) | ||
|
||
# Assert | ||
assert len(updated_data["watchlist"]) == 0 | ||
|
||
def test_adds_movie_to_empty_user_watchlist(): | ||
# Arrange | ||
movie = { | ||
"title": MOVIE_TITLE_1, | ||
|
@@ -100,7 +145,31 @@ 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_user_watchlist(): | ||
# Arrange | ||
movie = { | ||
"title": MOVIE_TITLE_1, | ||
"genre": GENRE_1, | ||
"rating": RATING_1 | ||
} | ||
movie_watched = { | ||
"title": MOVIE_TITLE_2, | ||
"genre": GENRE_2, | ||
"rating": RATING_2 | ||
} | ||
user_data = { | ||
"watchlist": [movie_watched] | ||
} | ||
|
||
# Act | ||
updated_data = add_to_watchlist(user_data, movie) | ||
|
||
# Assert | ||
assert len(updated_data["watchlist"]) == 2 | ||
assert updated_data["watchlist"][1]["title"] == MOVIE_TITLE_1 | ||
assert updated_data["watchlist"][1]["genre"] == GENRE_1 | ||
assert updated_data["watchlist"][1]["rating"] == RATING_1 | ||
|
||
def test_moves_movie_from_watchlist_to_empty_watched(): | ||
# Arrange | ||
janes_data = { | ||
|
@@ -118,13 +187,10 @@ 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.") | ||
# ******************************************************************************************* | ||
# ****** Add assertions here to test that the correct movie was added to "watched" ********** | ||
# ******************************************************************************************* | ||
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 | ||
|
@@ -142,13 +208,10 @@ def test_moves_movie_from_watchlist_to_watched(): | |
# Assert | ||
assert len(updated_data["watchlist"]) == 1 | ||
assert len(updated_data["watched"]) == 2 | ||
|
||
raise Exception("Test needs to be completed.") | ||
# ******************************************************************************************* | ||
# ****** Add assertions here to test that the correct movie was added to "watched" ********** | ||
# ******************************************************************************************* | ||
assert updated_data["watched"][1]["title"] == movie_to_watch["title"] | ||
assert updated_data["watched"][1]["genre"] == movie_to_watch["genre"] | ||
assert updated_data["watched"][1]["rating"] == movie_to_watch["rating"] | ||
|
||
@pytest.mark.skip() | ||
def test_does_nothing_if_movie_not_in_watchlist(): | ||
# Arrange | ||
movie_to_watch = HORROR_1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Way to go, even adding additional testing data!