Skip to content

Commit

Permalink
all tests for song
Browse files Browse the repository at this point in the history
  • Loading branch information
jottenlips committed Nov 29, 2019
1 parent b548496 commit c337e59
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions features/Songs/tests/test_song.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from features.Songs.song import resolve_song, resolve_songs, create_song
from features.Songs.song import resolve_song, resolve_songs, create_song, update_song
from aws_resources.mock_dynamo import setup_mocks, mock_song, another_mock_song, mock_create_song
from moto import mock_dynamodb2

Expand All @@ -19,4 +19,12 @@ def test_resolve_song():
def test_create_song():
setup_mocks()
response = create_song({}, {}, mock_create_song)
assert response['message'] == 'success' and response['song']['title'] == "It don't mean a thing"
assert response['message'] == 'success' and response['song']['title'] == 'It don\'t mean a thing'

@mock_dynamodb2
def test_update_song():
setup_mocks()
new_attr = {'title': 'new song title'}
updated_song = {**mock_song, **new_attr}
response = update_song({}, {}, mock_song)
assert response['message'] == 'success'

0 comments on commit c337e59

Please sign in to comment.