forked from AdaGold/viewing-party
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Ada Whales C17- Nishat Salsabil #106
Open
nishatsalsabil
wants to merge
11
commits into
ada-c17:master
Choose a base branch
from
nishatsalsabil: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
11 commits
Select commit
Hold shift + click to select a range
aab30f3
added 2 functions in party.py to pass first 5 tests in wave_01
nishatsalsabil f972751
all 9 test cases pass for wave_01 and first 4 functions work for wave_01
nishatsalsabil 07f4408
13 passed tests from wave 1 and wave 2
nishatsalsabil 22a1f87
tests 14 and 15 of wave_03 complete
nishatsalsabil 77de21e
Test cases up to 17 passing in wave_03
nishatsalsabil b8faff3
tests 1-18 passing and wave_03 complete
nishatsalsabil 8fc440f
tests up to 20 are passing and wave_04 complete
nishatsalsabil bcdcfc8
waves 01-05 complete, added docstrings for further clarity
nishatsalsabil 59c268e
updated wave_05
nishatsalsabil ff35d6d
testing new pat
nishatsalsabil 55c70f2
added link to another working solution in test_constants.py file
nishatsalsabil 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Viewing Party | ||
|
||
## Skills Assessed | ||
# testing pat, ignore this | ||
|
||
Solving problems with... | ||
|
||
|
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
Empty file.
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,8 @@ | |
from viewing_party.party import * | ||
from tests.test_constants import * | ||
|
||
@pytest.mark.skip() | ||
# Test 1 | ||
#@pytest.mark.skip() | ||
def test_create_successful_movie(): | ||
# Arrange | ||
movie_title = MOVIE_TITLE_1 | ||
|
@@ -15,11 +16,12 @@ def test_create_successful_movie(): | |
new_movie = create_movie(movie_title, genre, rating) | ||
|
||
# Assert | ||
assert new_movie["title"] is MOVIE_TITLE_1 | ||
assert new_movie["genre"] is GENRE_1 | ||
assert new_movie["title"] == MOVIE_TITLE_1 | ||
assert new_movie["genre"] == GENRE_1 | ||
assert new_movie["rating"] == pytest.approx(RATING_1) | ||
|
||
@pytest.mark.skip() | ||
# Test 2 | ||
#@pytest.mark.skip() | ||
def test_create_no_title_movie(): | ||
# Arrange | ||
movie_title = None | ||
|
@@ -32,7 +34,8 @@ def test_create_no_title_movie(): | |
# Assert | ||
assert new_movie is None | ||
|
||
@pytest.mark.skip() | ||
# Test 3 | ||
#@pytest.mark.skip() | ||
def test_create_no_genre_movie(): | ||
# Arrange | ||
movie_title = "Title A" | ||
|
@@ -45,7 +48,8 @@ def test_create_no_genre_movie(): | |
# Assert | ||
assert new_movie is None | ||
|
||
@pytest.mark.skip() | ||
# Test 4 | ||
#@pytest.mark.skip() | ||
def test_create_no_rating_movie(): | ||
# Arrange | ||
movie_title = "Title A" | ||
|
@@ -58,7 +62,8 @@ def test_create_no_rating_movie(): | |
# Assert | ||
assert new_movie is None | ||
|
||
@pytest.mark.skip() | ||
# Test 5 | ||
#@pytest.mark.skip() | ||
def test_adds_movie_to_user_watched(): | ||
# Arrange | ||
movie = { | ||
|
@@ -73,13 +78,15 @@ def test_adds_movie_to_user_watched(): | |
# Act | ||
updated_data = add_to_watched(user_data, movie) | ||
|
||
|
||
# Assert | ||
assert len(updated_data["watched"]) is 1 | ||
assert updated_data["watched"][0]["title"] is MOVIE_TITLE_1 | ||
assert updated_data["watched"][0]["genre"] is GENRE_1 | ||
assert updated_data["watched"][0]["rating"] is RATING_1 | ||
assert len(updated_data["watched"]) == 1 | ||
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() | ||
# Test 6 | ||
#@pytest.mark.skip() | ||
def test_adds_movie_to_user_watchlist(): | ||
# Arrange | ||
movie = { | ||
|
@@ -95,12 +102,13 @@ def test_adds_movie_to_user_watchlist(): | |
updated_data = add_to_watchlist(user_data, movie) | ||
|
||
# Assert | ||
assert len(updated_data["watchlist"]) is 1 | ||
assert updated_data["watchlist"][0]["title"] is MOVIE_TITLE_1 | ||
assert updated_data["watchlist"][0]["genre"] is GENRE_1 | ||
assert updated_data["watchlist"][0]["rating"] is RATING_1 | ||
assert len(updated_data["watchlist"]) == 1 | ||
assert updated_data["watchlist"][0]["title"] == MOVIE_TITLE_1 | ||
assert updated_data["watchlist"][0]["genre"] == GENRE_1 | ||
assert updated_data["watchlist"][0]["rating"] == RATING_1 | ||
|
||
@pytest.mark.skip() | ||
# Test 7 | ||
#@pytest.mark.skip() | ||
def test_moves_movie_from_watchlist_to_empty_watched(): | ||
# Arrange | ||
janes_data = { | ||
|
@@ -116,14 +124,18 @@ def test_moves_movie_from_watchlist_to_empty_watched(): | |
updated_data = watch_movie(janes_data, MOVIE_TITLE_1) | ||
|
||
# Assert | ||
assert len(updated_data["watchlist"]) is 0 | ||
assert len(updated_data["watched"]) is 1 | ||
assert len(updated_data["watchlist"]) == 0 | ||
assert len(updated_data["watched"]) == 1 | ||
|
||
# ******************************************************************************************* | ||
# ****** 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 | ||
assert updated_data["watchlist"] == [] | ||
# ******************************************************************************************* | ||
|
||
@pytest.mark.skip() | ||
# Test 8 | ||
#pytest.mark.skip() | ||
def test_moves_movie_from_watchlist_to_watched(): | ||
# Arrange | ||
movie_to_watch = HORROR_1 | ||
|
@@ -139,14 +151,17 @@ def test_moves_movie_from_watchlist_to_watched(): | |
updated_data = watch_movie(janes_data, movie_to_watch["title"]) | ||
|
||
# Assert | ||
assert len(updated_data["watchlist"]) is 1 | ||
assert len(updated_data["watched"]) is 2 | ||
assert len(updated_data["watchlist"]) == 1 | ||
assert len(updated_data["watched"]) == 2 | ||
|
||
# ******************************************************************************************* | ||
# ****** 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"] | ||
Comment on lines
+158
to
+160
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. 👍🏻 |
||
# ******************************************************************************************* | ||
|
||
@pytest.mark.skip() | ||
# Test 9 | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
from viewing_party.party import * | ||
from tests.test_constants import * | ||
|
||
@pytest.mark.skip() | ||
# Test 14 | ||
#@pytest.mark.skip() | ||
def test_my_unique_movies(): | ||
# Arrange | ||
amandas_data = clean_wave_3_data() | ||
|
@@ -16,7 +17,8 @@ def test_my_unique_movies(): | |
assert INTRIGUE_2 in amandas_unique_movies | ||
assert amandas_data == clean_wave_3_data() | ||
|
||
@pytest.mark.skip() | ||
# Test 15 | ||
#@pytest.mark.skip() | ||
def test_my_not_unique_movies(): | ||
# Arrange | ||
amandas_data = clean_wave_3_data() | ||
|
@@ -28,7 +30,8 @@ def test_my_not_unique_movies(): | |
# Arrange | ||
assert len(amandas_unique_movies) == 0 | ||
|
||
@pytest.mark.skip() | ||
# Test 16 | ||
#@pytest.mark.skip() | ||
def test_friends_unique_movies(): | ||
# Arrange | ||
amandas_data = clean_wave_3_data() | ||
|
@@ -43,7 +46,8 @@ def test_friends_unique_movies(): | |
assert FANTASY_4 in friends_unique_movies | ||
assert amandas_data == clean_wave_3_data() | ||
|
||
@pytest.mark.skip() | ||
# Test 17 | ||
#@pytest.mark.skip() | ||
def test_friends_unique_movies_not_duplicated(): | ||
# Arrange | ||
amandas_data = clean_wave_3_data() | ||
|
@@ -56,10 +60,12 @@ def test_friends_unique_movies_not_duplicated(): | |
assert len(friends_unique_movies) == 3 | ||
|
||
# ************************************************************************************************* | ||
# ****** Add assertions here to test that the correct movies are in friends_unique_movies ********** | ||
assert HORROR_1 in friends_unique_movies | ||
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. 👍🏻 |
||
assert INTRIGUE_3 in friends_unique_movies | ||
# ************************************************************************************************** | ||
|
||
@pytest.mark.skip() | ||
# Test 18 | ||
#@pytest.mark.skip() | ||
def test_friends_not_unique_movies(): | ||
# Arrange | ||
amandas_data = { | ||
|
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.
👍🏻