Skip to content

Commit

Permalink
Added [tests/test_search.py]
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzeman committed Mar 31, 2015
1 parent 94bc384 commit 9bd77a5
Show file tree
Hide file tree
Showing 9 changed files with 1,322 additions and 8 deletions.
11 changes: 10 additions & 1 deletion tests/core/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import os
import six

if six.PY2:
try:
from six import cStringIO as BufferIO
except ImportError:
from six import StringIO as BufferIO
else:
from io import BytesIO as BufferIO

TESTS_PATH = os.path.abspath(os.path.dirname(__file__) + os.path.sep + '..')

Expand All @@ -10,4 +19,4 @@ def read(path, mode='rb'):
path = os.path.abspath(path)

with open(path, mode) as fp:
return fp.read()
return BufferIO(fp.read())
29 changes: 29 additions & 0 deletions tests/fixtures/search/lookup/imdb/tt0848228.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"type":"movie",
"score":null,
"movie":{
"title":"The Avengers",
"overview":"When an unexpected enemy emerges and threatens global safety and security, Nick Fury, director of the international peacekeeping agency known as S.H.I.E.L.D., finds himself in need of a team to pull the world back from the brink of disaster. Spanning the globe, a daring recruitment effort begins!",
"year":2012,
"images":{
"poster":{
"full":"https://walter.trakt.us/images/movies/000/014/701/posters/original/293ce7103a.jpg",
"medium":"https://walter.trakt.us/images/movies/000/014/701/posters/medium/293ce7103a.jpg",
"thumb":"https://walter.trakt.us/images/movies/000/014/701/posters/thumb/293ce7103a.jpg"
},
"fanart":{
"full":"https://walter.trakt.us/images/movies/000/014/701/fanarts/original/7d93500475.jpg",
"medium":"https://walter.trakt.us/images/movies/000/014/701/fanarts/medium/7d93500475.jpg",
"thumb":"https://walter.trakt.us/images/movies/000/014/701/fanarts/thumb/7d93500475.jpg"
}
},
"ids":{
"trakt":14701,
"slug":"the-avengers-2012",
"imdb":"tt0848228",
"tmdb":24428
}
}
}
]
31 changes: 31 additions & 0 deletions tests/fixtures/search/lookup/imdb/tt0903747.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
{
"type": "show",
"score": null,
"show": {
"title": "Breaking Bad",
"overview": "Walter White, a struggling high school chemistry teacher, is diagnosed with advanced lung cancer. He turns to a life of crime, producing and selling methamphetamine accompanied by a former student, Jesse Pinkman, with the aim of securing his family's financial future before he dies.",
"year": 2008,
"images": {
"poster": {
"full": "https://walter.trakt.us/images/shows/000/001/388/posters/original/fa39b59954.jpg",
"medium": "https://walter.trakt.us/images/shows/000/001/388/posters/medium/fa39b59954.jpg",
"thumb": "https://walter.trakt.us/images/shows/000/001/388/posters/thumb/fa39b59954.jpg"
},
"fanart": {
"full": "https://walter.trakt.us/images/shows/000/001/388/fanarts/original/fdbc0cb02d.jpg",
"medium": "https://walter.trakt.us/images/shows/000/001/388/fanarts/medium/fdbc0cb02d.jpg",
"thumb": "https://walter.trakt.us/images/shows/000/001/388/fanarts/thumb/fdbc0cb02d.jpg"
}
},
"ids": {
"trakt": 1388,
"slug": "breaking-bad",
"tvdb": 81189,
"imdb": "tt0903747",
"tmdb": 1396,
"tvrage": 18164
}
}
}
]
46 changes: 46 additions & 0 deletions tests/fixtures/search/lookup/imdb/tt0959621.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[
{
"type": "episode",
"score": null,
"episode": {
"season": 1,
"number": 1,
"title": "Pilot",
"overview": "When an unassuming high school chemistry teacher discovers he has a rare form of lung cancer, he decides to team up with a former student and create a top of the line crystal meth in a used RV, to provide for his family once he is gone.",
"images": {
"screenshot": {
"full": "https://walter.trakt.us/images/episodes/000/073/482/screenshots/original/ef3352bcb8.jpg",
"medium": "https://walter.trakt.us/images/episodes/000/073/482/screenshots/medium/ef3352bcb8.jpg",
"thumb": "https://walter.trakt.us/images/episodes/000/073/482/screenshots/thumb/ef3352bcb8.jpg"
}
},
"ids": {
"trakt": 73482,
"tvdb": 349232,
"imdb": "tt0959621",
"tmdb": 62085,
"tvrage": 637041
}
},
"show": {
"title": "Breaking Bad",
"year": "2008",
"ids": {
"trakt": 1388,
"slug": "breaking-bad"
},
"images": {
"poster": {
"full": "https://walter.trakt.us/images/shows/000/001/388/posters/original/fa39b59954.jpg",
"medium": "https://walter.trakt.us/images/shows/000/001/388/posters/medium/fa39b59954.jpg",
"thumb": "https://walter.trakt.us/images/shows/000/001/388/posters/thumb/fa39b59954.jpg"
},
"fanart": {
"full": null,
"medium": "https://walter.trakt.us/images/shows/000/001/388/fanarts/medium/fdbc0cb02d.jpg",
"thumb": "https://walter.trakt.us/images/shows/000/001/388/fanarts/thumb/fdbc0cb02d.jpg"
}
}
}
}
]
Loading

0 comments on commit 9bd77a5

Please sign in to comment.