Skip to content

Commit

Permalink
Tests: Add mock data for progress/collection
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jan 12, 2022
1 parent f59e560 commit cc0be4a
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 3 deletions.
83 changes: 83 additions & 0 deletions tests/mock_data/shows.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,89 @@
{"username":"sean","private":false,"name":"Sean Rudford","vip":true,"vip_ep":false}
]
},
"shows/game-of-thrones/progress/collection": {
"GET": {
"aired": 2,
"completed": 2,
"last_collected_at": "2020-08-25T20:10:33.000Z",
"seasons": [
{
"number": 1,
"title": null,
"aired": 2,
"completed": 2,
"episodes": [
{
"number": 1,
"completed": true,
"collected_at": "2011-12-18T12:21:20.000Z"
},
{
"number": 2,
"completed": true,
"collected_at": "2011-12-18T14:18:22.000Z"
}
]
}
],
"hidden_seasons": [],
"next_episode": null,
"last_episode": {
"season": 1,
"number": 1,
"title": "Winter Is Coming",
"ids": {
"trakt": 73640,
"tvdb": 3254641,
"imdb": "tt1480055",
"tmdb": 63056,
"tvrage": 1065008299
}
}
}
},
"shows/game-of-thrones/progress/watched": {
"GET": {
"aired": 2,
"completed": 0,
"last_watched_at": null,
"reset_at": null,
"seasons": [
{
"number": 1,
"title": null,
"aired": 2,
"completed": 0,
"episodes": [
{
"number": 1,
"completed": false,
"last_watched_at": null
},
{
"number": 2,
"completed": false,
"last_watched_at": null
}
]
}
],
"hidden_seasons": [],
"next_episode": {
"season": 1,
"number": 1,
"title": "Winter Is Coming",
"ids": {
"trakt": 73640,
"tvdb": 3254641,
"imdb": "tt1480055",
"tmdb": 63056,
"tvrage": 1065008299
}
},
"last_episode": null
}
},
"shows/the-walking-dead?extended=full": {
"GET": {"title":"The Walking Dead","year":2010,"ids":{"trakt":1393,"slug":"the-walking-dead","tvdb":153021,"imdb":"tt1520211","tmdb":1402,"tvrage":25056},"overview":"The world we knew is gone. An epidemic of apocalyptic proportions has swept the globe causing the dead to rise and feed on the living. In a matter of months society has crumbled. In a world ruled by the dead, we are forced to finally start living. Based on a comic book series of the same name by Robert Kirkman, this AMC project focuses on the world after a zombie apocalypse. The series follows a police officer, Rick Grimes, who wakes up from a coma to find the world ravaged with zombies. Looking for his family, he and a group of survivors attempt to battle against the zombies in order to stay alive.\n","first_aired":"2010-10-31T07:00:00.000Z","airs":{"day":"Sunday","time":"21:00","timezone":"America/New_York"},"runtime":60,"certification":"TV-MA","network":"AMC","country":"us","trailer":"http://youtube.com/watch?v=R1v0uFms68U","homepage":"http://www.amctv.com/shows/the-walking-dead/","status":"returning series","rating":8.62829,"votes":34161,"updated_at":"2016-04-24T10:50:26.000Z","language":"en","available_translations":["en","de","sv","it","pt","tr","ru","zh","fr","es","nl","pl","bg","el","hu","ja","he","da","cs","ko","cn","bs","hr","fa","lt","lv","ro","sr","vi","et","uk","fi","th","id","ms"],"genres":["drama","action","horror","suspense"],"aired_episodes":83}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/test_shows.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def test_show_comment():

def test_collection_progress():
show = TVShow('Game of Thrones')
assert show.progress is None
assert show.collection_progress() is None
assert show.watched_progress() is None
assert isinstance(show.progress, dict)
assert isinstance(show.collection_progress(), dict)
assert isinstance(show.watched_progress(), dict)


def test_rate_show():
Expand Down

0 comments on commit cc0be4a

Please sign in to comment.