-
Notifications
You must be signed in to change notification settings - Fork 35
/
people_test.go
217 lines (184 loc) · 6.09 KB
/
people_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
package tmdb
const (
tomCruiseID = 500
jasonMomoaID = 117642
)
func (suite *TMBDTestSuite) TestGetPersonDetails() {
jasonMomoa, err := suite.client.GetPersonDetails(jasonMomoaID, nil)
suite.Nil(err)
suite.Equal("Jason Momoa", jasonMomoa.Name)
}
func (suite *TMBDTestSuite) TestGetPersonDetailsFail() {
_, err := suite.client.GetPersonDetails(0, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonDetailsWithOptions() {
options := make(map[string]string)
options["language"] = "pt-BR"
jasonMomoa, err := suite.client.GetPersonDetails(jasonMomoaID, options)
suite.Nil(err)
suite.Equal("Jason Momoa", jasonMomoa.Name)
}
func (suite *TMBDTestSuite) TestGetPersonChanges() {
jasonMomoa, err := suite.client.GetPersonChanges(jasonMomoaID, nil)
suite.Nil(err)
suite.NotNil(jasonMomoa.Changes)
}
func (suite *TMBDTestSuite) TestGetPersonChangesFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonChanges(0, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonChangesWithOptions() {
options := make(map[string]string)
options["page"] = "1"
jasonMomoa, err := suite.client.GetPersonChanges(jasonMomoaID, options)
suite.Nil(err)
suite.NotNil(jasonMomoa.Changes)
}
func (suite *TMBDTestSuite) TestGetPersonMovieCredits() {
jasonMomoa, err := suite.client.GetPersonMovieCredits(jasonMomoaID, nil)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonMovieCreditsFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonMovieCredits(0, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonMovieCreditsWithOptions() {
options := make(map[string]string)
options["language"] = "pt-BR"
jasonMomoa, err := suite.client.GetPersonMovieCredits(jasonMomoaID, options)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonTVCredits() {
jasonMomoa, err := suite.client.GetPersonTVCredits(jasonMomoaID, nil)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonTVCreditsFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonTVCredits(0, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonTVCreditsWithOptions() {
options := make(map[string]string)
options["language"] = "pt-BR"
jasonMomoa, err := suite.client.GetPersonTVCredits(jasonMomoaID, options)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonCombinedCredits() {
jasonMomoa, err := suite.client.GetPersonCombinedCredits(jasonMomoaID, nil)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonCombinedCreditsFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonCombinedCredits(0, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonCombinedCreditsWithOptions() {
options := make(map[string]string)
options["language"] = "pt-BR"
jasonMomoa, err := suite.client.GetPersonCombinedCredits(jasonMomoaID, options)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonExternalIDs() {
jasonMomoa, err := suite.client.GetPersonExternalIDs(jasonMomoaID, nil)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonExternalIDsFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonExternalIDs(0, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonExternalIDsWithOptions() {
options := make(map[string]string)
options["language"] = "pt-BR"
jasonMomoa, err := suite.client.GetPersonExternalIDs(jasonMomoaID, options)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonImages() {
jasonMomoa, err := suite.client.GetPersonImages(jasonMomoaID)
suite.Nil(err)
suite.NotNil(jasonMomoa.ID)
}
func (suite *TMBDTestSuite) TestGetPersonImagesFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonImages(0)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonTaggedImages() {
tomCruise, err := suite.client.GetPersonTaggedImages(tomCruiseID, nil)
suite.Nil(err)
suite.NotNil(tomCruise.ID)
}
func (suite *TMBDTestSuite) TestGetPersonTaggedImagesFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonTaggedImages(0, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonTaggedImagesWithOptions() {
options := make(map[string]string)
options["language"] = "en-US"
tomCruise, err := suite.client.GetPersonTaggedImages(tomCruiseID, options)
suite.Nil(err)
suite.NotNil(tomCruise.ID)
}
func (suite *TMBDTestSuite) TestGetPersonTranslations() {
tomCruise, err := suite.client.GetPersonTranslations(tomCruiseID, nil)
suite.Nil(err)
suite.NotNil(tomCruise.ID)
}
func (suite *TMBDTestSuite) TestGetPersonTranslationsFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonTranslations(0, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonTranslationsWithOptions() {
options := make(map[string]string)
options["language"] = "en-US"
tomCruise, err := suite.client.GetPersonTranslations(tomCruiseID, options)
suite.Nil(err)
suite.NotNil(tomCruise.ID)
}
func (suite *TMBDTestSuite) TestGetPersonLatest() {
tomCruise, err := suite.client.GetPersonLatest(nil)
suite.Nil(err)
suite.NotNil(tomCruise.ID)
}
func (suite *TMBDTestSuite) TestGetPersonLatestFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonLatest(nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonLatestWithOptions() {
options := make(map[string]string)
options["language"] = "en-US"
tomCruise, err := suite.client.GetPersonLatest(options)
suite.Nil(err)
suite.NotNil(tomCruise.ID)
}
func (suite *TMBDTestSuite) TestGetPersonPopular() {
tomCruise, err := suite.client.GetPersonPopular(nil)
suite.Nil(err)
suite.NotNil(tomCruise.Page)
}
func (suite *TMBDTestSuite) TestGetPersonPopularFail() {
suite.client.apiKey = ""
_, err := suite.client.GetPersonPopular(nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetPersonPopularWithOptions() {
options := make(map[string]string)
options["language"] = "en-US"
tomCruise, err := suite.client.GetPersonPopular(options)
suite.Nil(err)
suite.NotNil(tomCruise.Page)
}