Skip to content

Sphinx - Sarah Koch and Salma Anany #22

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

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c1a004c
Adds comment to README.md Viewing Party section
svankoch Sep 23, 2024
afbb378
make change to README skills
SalmaAnany Sep 23, 2024
3a402b6
Hello Hello
SalmaAnany Sep 23, 2024
fcece58
Removes skip decorators for completed Wave 1 tests. Those requiring a…
svankoch Sep 23, 2024
eba0c6f
Removes raised exception and skip decorator from test_moves_movie_fro…
svankoch Sep 23, 2024
c9d710d
Modifies test_wave_01.py function test_move_movie_from_watchlist_to_w…
svankoch Sep 23, 2024
ba1c3b9
Modifies test_wave_01.py. Corrects assertion statements in test_moves…
svankoch Sep 23, 2024
8388381
step1 in wave 1
SalmaAnany Sep 24, 2024
32d9de6
Merge branch 'main' of https://github.com/SalmaAnany/viewing-party
svankoch Sep 24, 2024
5b35a23
funcation 3 in wave 1
SalmaAnany Sep 24, 2024
721c540
complete everything in wave one except tests
SalmaAnany Sep 24, 2024
fb72097
complete everything in wave one except tests
SalmaAnany Sep 24, 2024
a3f6d60
Merge branch 'main' of https://github.com/SalmaAnany/viewing-party
svankoch Sep 24, 2024
5fbb015
complete funcation one in wave Three
SalmaAnany Sep 25, 2024
975c107
Adds get_watched_avg_rating() to party.py. Wave 2 skip decorators com…
svankoch Sep 25, 2024
ae7c208
Adds get_most_watched_genre() to party.py. All Wave 2 tests now pass.
svankoch Sep 25, 2024
2a277cb
complete funcation one in wave Three
SalmaAnany Sep 25, 2024
aa28e59
Merge remote-tracking branch 'origin/main'
SalmaAnany Sep 25, 2024
ee3431f
complete wave Four
SalmaAnany Sep 26, 2024
ab10bec
Uncomments Wave 05 user data in play_tester.py, comments out all othe…
svankoch Sep 26, 2024
9861387
Adds get_new_rec_by_genre() to Wave 5 in party.py. Passes 2 of 3 Wave…
svankoch Sep 26, 2024
ae66c23
Updates get_rec_from_favorites() in Wave 5, which now passes all test…
svankoch Sep 26, 2024
40f9535
Refactors Wave 3 in party.py.
svankoch Sep 27, 2024
b2fe61b
Refactors Wave 3 in party.py.
svankoch Sep 27, 2024
9de130c
Merge branch 'main' of https://github.com/SalmaAnany/viewing-party
svankoch Sep 27, 2024
5d2c539
Refactors create_movie() in Wave 1 of party.py
svankoch Sep 27, 2024
3380b80
Refactors add_to_watched() in party.py Wave 1
svankoch Sep 27, 2024
0e2390f
Refactors add_to_watchlist() in party.py Wave 1
svankoch Sep 27, 2024
3e3603f
Refactors watch_movie() in party.py Wave 1
svankoch Sep 27, 2024
f18e10f
Adds docstrings to the Wave 1 functions in party.py.
svankoch Sep 27, 2024
1ac0638
Refactors get_watched_avg_rating() in Wave 2 of party.py
svankoch Sep 27, 2024
404c24b
Refactors get_most_watched_genre() in party.py Wave 2
svankoch Sep 27, 2024
7afc59d
Adds docstrings to Wave 3 functions in party.py. Moves helper functio…
svankoch Sep 27, 2024
abc8360
Adds docstrings to get_available_recs() in Wave 4 of party.py. Ensure…
svankoch Sep 27, 2024
c871272
Renames variable in get_available_recs() for clarity. Removes extra w…
svankoch Sep 27, 2024
ceaf7ce
Renames additional variable in Wave 4 for clarity.
svankoch Sep 27, 2024
b952f0e
Refactors Wave 5 functions. Creates docstring for get_rec_from_favori…
svankoch Sep 27, 2024
12a43db
Deletes skip decorators and raised exceptions which were previous com…
svankoch Sep 27, 2024
b9ff167
Refactors waves further, creating and refactoring helper functions in…
svankoch Sep 27, 2024
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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to add and commit these files in the .idea directory? I don't think these changes are needed for the project and should be removed from the tracked changes before opening a PR.

While adding these changes as a PR, doesn't affect this project right now, when you're in industry it's best practice to only commit changes relevant to your work so that the codebase doesn't become cluttered. Be sure to review what files you have staged for commit before you add them so that you don't add files that shouldn't be tracked to the commit history.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/viewing-party.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Viewing Party

## Skills Assessed

## Comment by Sarah --> 'Hello, i dont know how to comment'
## Skills Assessed -->
Solving problems with...

- Conditional logic
Expand Down
12 changes: 6 additions & 6 deletions play_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
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())
Expand All @@ -25,5 +25,5 @@
#pp.pprint(clean_wave_4_data())

# Wave 05 user data
#print("\n-----Wave 05 user_data-----")
#pp.pprint(clean_wave_5_data())
print("\n-----Wave 05 user_data-----")
pp.pprint(clean_wave_5_data())
27 changes: 6 additions & 21 deletions tests/test_wave_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -58,7 +54,6 @@ def test_create_no_rating_movie():
# Assert
assert new_movie is None

@pytest.mark.skip()
def test_adds_movie_to_user_watched():
# Arrange
movie = {
Expand All @@ -79,7 +74,6 @@ 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_non_empty_user_watched():
# Arrange
movie = {
Expand All @@ -99,7 +93,6 @@ 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()
def test_adds_movie_to_user_watchlist():
# Arrange
movie = {
Expand All @@ -120,7 +113,6 @@ 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_non_empty_user_watchlist():
# Arrange
movie = {
Expand All @@ -140,7 +132,6 @@ 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()
def test_moves_movie_from_watchlist_to_empty_watched():
# Arrange
janes_data = {
Expand All @@ -158,13 +149,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
Comment on lines +152 to +154

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job adding assertions to this test 👍


@pytest.mark.skip()
def test_moves_movie_from_watchlist_to_watched():
# Arrange
movie_to_watch = HORROR_1
Expand All @@ -182,13 +170,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"]
Comment on lines +173 to +175

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could capture the logic written in lines 173-175 as:

assert HORROR_1 in updated_data["watched"]

Also since you're testing that HORROR_1 is in the watched list, you might also to test that HORROR_1 is not in the watchlist.


@pytest.mark.skip()
def test_does_nothing_if_movie_not_in_watchlist():
# Arrange
movie_to_watch = HORROR_1
Expand Down
5 changes: 0 additions & 5 deletions tests/test_wave_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
def test_calculates_watched_average_rating():
# Arrange
janes_data = clean_wave_2_data()
Expand All @@ -14,7 +13,6 @@ def test_calculates_watched_average_rating():
assert average == pytest.approx(3.58333)
assert janes_data == clean_wave_2_data()

@pytest.mark.skip()
def test_empty_watched_average_rating_is_zero():
# Arrange
janes_data = {
Expand All @@ -27,7 +25,6 @@ def test_empty_watched_average_rating_is_zero():
# Assert
assert average == pytest.approx(0.0)

@pytest.mark.skip()
def test_most_watched_genre():
# Arrange
janes_data = clean_wave_2_data()
Expand All @@ -39,7 +36,6 @@ def test_most_watched_genre():
assert popular_genre == "Fantasy"
assert janes_data == clean_wave_2_data()

@pytest.mark.skip()
def test_most_watched_genre_order_mixed():
# Arrange
janes_data = clean_wave_2b_data()
Expand All @@ -51,7 +47,6 @@ def test_most_watched_genre_order_mixed():
assert popular_genre == "Fantasy"
assert janes_data == clean_wave_2b_data()

@pytest.mark.skip()
def test_genre_is_None_if_empty_watched():
# Arrange
janes_data = {
Expand Down
15 changes: 4 additions & 11 deletions tests/test_wave_03.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
def test_my_unique_movies():
# Arrange
amandas_data = clean_wave_3_data()
Expand All @@ -16,7 +15,6 @@ 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
amandas_data = clean_wave_3_data()
Expand All @@ -28,7 +26,6 @@ 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 +40,6 @@ 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,13 +50,10 @@ def test_friends_unique_movies_not_duplicated():

# Assert
assert len(friends_unique_movies) == 3

raise Exception("Test needs to be completed.")
# *************************************************************************************************
# ****** Add assertions here to test that the correct movies are in friends_unique_movies **********
# **************************************************************************************************

@pytest.mark.skip()
assert INTRIGUE_3 in friends_unique_movies
assert FANTASY_4 in friends_unique_movies
assert HORROR_1 in friends_unique_movies
Comment on lines +53 to +55

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice job checking that the correct movies are in friends_unique_watched. Consider adding an assertion to check that the movie that was added to the first friend's watched list on line 50 was not added to Amanda's watched list:

assert INTRIGUE_3 not in amandas_data["watched"]


def test_friends_not_unique_movies():
# Arrange
amandas_data = {
Expand Down
3 changes: 0 additions & 3 deletions tests/test_wave_04.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
def test_get_available_friend_rec():
# Arrange
amandas_data = clean_wave_4_data()
Expand All @@ -16,7 +15,6 @@ def test_get_available_friend_rec():
assert FANTASY_4b in recommendations
assert amandas_data == clean_wave_4_data()

@pytest.mark.skip()
def test_no_available_friend_recs():
# Arrange
amandas_data = {
Expand All @@ -38,7 +36,6 @@ def test_no_available_friend_recs():
# Assert
assert len(recommendations) == 0

@pytest.mark.skip()
def test_no_available_friend_recs_watched_all():
# Arrange
amandas_data = {
Expand Down
15 changes: 5 additions & 10 deletions tests/test_wave_05.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from viewing_party.party import *
from tests.test_constants import *

@pytest.mark.skip()
def test_new_genre_rec():
# Arrange
sonyas_data = clean_wave_5_data()
Expand All @@ -17,7 +16,6 @@ def test_new_genre_rec():
assert FANTASY_4b in recommendations
assert sonyas_data == clean_wave_5_data()

@pytest.mark.skip()
def test_new_genre_rec_from_empty_watched():
# Arrange
sonyas_data = {
Expand All @@ -38,7 +36,6 @@ def test_new_genre_rec_from_empty_watched():
# Assert
assert len(recommendations) == 0

@pytest.mark.skip()
def test_new_genre_rec_from_empty_friends():
# Arrange
sonyas_data = {
Expand All @@ -53,12 +50,12 @@ def test_new_genre_rec_from_empty_friends():
]
}

raise Exception("Test needs to be completed.")
# *********************************************************************
# ****** Complete the Act and Assert Portions of these tests **********
# *********************************************************************
# Act
recommendations = get_new_rec_by_genre(sonyas_data)

@pytest.mark.skip()
# Assert
assert len(recommendations) == 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing the assertion len(recommendations) == 0 only enforces that recommendations is something we can get the length of (and it's empty). If we write the assertion like assert recommendations == [] it guarantees the thing in recommendations is actually a list (and it's empty).


def test_unique_rec_from_favorites():
# Arrange
sonyas_data = clean_wave_5_data()
Expand All @@ -72,7 +69,6 @@ def test_unique_rec_from_favorites():
assert INTRIGUE_2b in recommendations
assert sonyas_data == clean_wave_5_data()

@pytest.mark.skip()
def test_unique_from_empty_favorites():
# Arrange
sonyas_data = {
Expand All @@ -94,7 +90,6 @@ def test_unique_from_empty_favorites():
# Assert
assert len(recommendations) == 0

@pytest.mark.skip()
def test_new_rec_from_empty_friends():
# Arrange
sonyas_data = {
Expand Down
Loading