-
Notifications
You must be signed in to change notification settings - Fork 57
/
tvseasons_test.go
62 lines (53 loc) · 2.07 KB
/
tvseasons_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package tmdb
import (
. "gopkg.in/check.v1"
)
const gameOfThronesFirstSeasonID int = 3624
func (s *TmdbSuite) TestGetTvSeasonInfo(c *C) {
result, err := s.tmdb.GetTvSeasonInfo(gameOfThronesID, 1, nil)
s.baseTest(&result, err, c)
c.Assert(result.Name, Equals, "Season 1")
c.Assert(result.AirDate, Equals, "2011-04-17")
c.Assert(result.Episodes, HasLen, 10)
c.Assert(result.ID, Equals, 3624)
c.Assert(result.SeasonNumber, Equals, 1)
}
func (s *TmdbSuite) TestGetTvSeasonChanges(c *C) {
result, err := s.tmdb.GetTvSeasonChanges(gameOfThronesFirstSeasonID, nil)
s.baseTest(&result, err, c)
c.Assert(result.Changes, NotNil)
allResultLength := len(result.Changes)
var janOptions = make(map[string]string)
janOptions["start_date"] = "2015-01-01"
janOptions["end_date"] = "2015-01-14"
janResult, err := s.tmdb.GetTvSeasonChanges(gameOfThronesFirstSeasonID, janOptions)
s.baseTest(&janResult, err, c)
c.Assert(janResult.Changes, NotNil)
c.Assert(len(janResult.Changes) >= allResultLength, Equals, true)
}
func (s *TmdbSuite) TestGetTvSeasonCredits(c *C) {
result, err := s.tmdb.GetTvSeasonCredits(gameOfThronesID, 1)
s.baseTest(&result, err, c)
c.Assert(result.ID, Equals, gameOfThronesFirstSeasonID)
c.Assert(result.Cast, Not(HasLen), 0)
c.Assert(result.Cast[0].Character, Equals, "Eddard Stark")
c.Assert(result.Cast[0].Name, Equals, "Sean Bean")
}
func (s *TmdbSuite) TestGetTvSeasonExternalIds(c *C) {
result, err := s.tmdb.GetTvSeasonExternalIds(gameOfThronesID, 1, nil)
s.baseTest(&result, err, c)
c.Assert(result.ID, Equals, gameOfThronesFirstSeasonID)
c.Assert(result.TvdbID, Equals, 364731)
}
func (s *TmdbSuite) TestGetTvSeasonImages(c *C) {
result, err := s.tmdb.GetTvSeasonImages(gameOfThronesID, 1, nil)
s.baseTest(&result, err, c)
c.Assert(result.ID, Equals, gameOfThronesFirstSeasonID)
c.Assert(result.Posters, Not(HasLen), 0)
}
func (s *TmdbSuite) TestGetTvSeasonVideos(c *C) {
result, err := s.tmdb.GetTvSeasonVideos(gameOfThronesID, 1, nil)
s.baseTest(&result, err, c)
c.Assert(result.ID, Equals, gameOfThronesFirstSeasonID)
c.Assert(result.Results, NotNil)
}