Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fulder committed Oct 26, 2021
1 parent 69e9a9c commit 7697ec4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions test/unittest/test_watch_history_by_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ class TestPost:

@patch("api.watch_history_by_collection.watch_history_db.add_item")
@patch("api.watch_history_by_collection.anime_api.post_anime")
def test_success(self, mocked_post_anime, mocked_post):
@patch("api.watch_history_by_collection.watch_history_db.get_item")
def test_success(self, mocked_get_item, mocked_post_anime, mocked_post):
mocked_post_anime.return_value = {
"id": "123"
}
Expand Down Expand Up @@ -269,7 +270,8 @@ def test_empty_body(self, mocked_post):

@patch("api.watch_history_by_collection.watch_history_db.add_item")
@patch("api.watch_history_by_collection.shows_api.post_show")
def test_show_success(self, mocked_post_show, mocked_post):
@patch("api.watch_history_by_collection.watch_history_db.get_item")
def test_show_success(self, mocked_get_item, mocked_post_show, mocked_post):
mocked_post_show.return_value = {
"id": "123"
}
Expand All @@ -286,7 +288,8 @@ def test_show_success(self, mocked_post_show, mocked_post):

@patch("api.watch_history_by_collection.watch_history_db.add_item")
@patch("api.watch_history_by_collection.movie_api.post_movie")
def test_movie_success(self, mocked_post_movie, mocked_post):
@patch("api.watch_history_by_collection.watch_history_db.get_item")
def test_movie_success(self, mocked_get_item, mocked_post_movie, mocked_post):
mocked_post_movie.return_value = {
"id": "123"
}
Expand Down
6 changes: 3 additions & 3 deletions test/unittest/test_watch_history_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def test_change_watched_eps(mocked_watch_history_db):

assert mock_func.update_values == {
'ExpressionAttributeNames': {'#p': 'ep_progress', '#w': 'watched_eps'},
'ExpressionAttributeValues': {':i': 1, ':p': '20.0'},
'ExpressionAttributeValues': {':i': 1, ':p': 20.0},
'Key': {'item_id': '123123', 'username': 'TEST_USERNAME'},
'UpdateExpression': 'SET #w=#w+:i, #p=:p'
}
Expand All @@ -370,7 +370,7 @@ def test_change_watched_eps_removal(mocked_watch_history_db):

assert mock_func.update_values == {
'ExpressionAttributeNames': {'#p': 'ep_progress', '#w': 'watched_eps'},
'ExpressionAttributeValues': {':i': -1, ':p': '0.0'},
'ExpressionAttributeValues': {':i': -1, ':p': 0.0},
'Key': {'item_id': '123123', 'username': 'TEST_USERNAME'},
'UpdateExpression': 'SET #w=#w+:i, #p=:p'
}
Expand All @@ -393,7 +393,7 @@ def test_change_watched_specials(mocked_watch_history_db):

assert mock_func.update_values == {
'ExpressionAttributeNames': {'#p': 'special_progress', '#w': 'watched_specials'},
'ExpressionAttributeValues': {':i': 1, ':p': '15.0'},
'ExpressionAttributeValues': {':i': 1, ':p': 15.0},
'Key': {'item_id': '123123', 'username': 'TEST_USERNAME'},
'UpdateExpression': 'SET #w=#w+:i, #p=:p'
}

0 comments on commit 7697ec4

Please sign in to comment.