kuapir 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +77 -0
- data/LICENSE +21 -0
- data/README.md +170 -0
- data/Rakefile +12 -0
- data/docs/BoxOffice.md +26 -0
- data/docs/BoxOfficeResponse.md +20 -0
- data/docs/Company.md +18 -0
- data/docs/Country.md +18 -0
- data/docs/DigitalReleaseItem.md +44 -0
- data/docs/DigitalReleaseResponse.md +22 -0
- data/docs/Distribution.md +28 -0
- data/docs/DistributionResponse.md +20 -0
- data/docs/Episode.md +28 -0
- data/docs/Fact.md +22 -0
- data/docs/FactResponse.md +20 -0
- data/docs/Film.md +100 -0
- data/docs/FilmSearchByFiltersResponse.md +22 -0
- data/docs/FilmSearchByFiltersResponseItems.md +42 -0
- data/docs/FilmSearchResponse.md +24 -0
- data/docs/FilmSearchResponseFilms.md +42 -0
- data/docs/FilmSequelsAndPrequelsResponse.md +30 -0
- data/docs/FilmTopResponse.md +20 -0
- data/docs/FilmTopResponseFilms.md +38 -0
- data/docs/FilmsApi.md +1126 -0
- data/docs/FiltersResponse.md +20 -0
- data/docs/FiltersResponseCountries.md +20 -0
- data/docs/FiltersResponseGenres.md +20 -0
- data/docs/Genre.md +18 -0
- data/docs/ImageResponse.md +22 -0
- data/docs/ImageResponseItems.md +20 -0
- data/docs/PersonByNameResponse.md +20 -0
- data/docs/PersonByNameResponseItems.md +28 -0
- data/docs/PersonResponse.md +50 -0
- data/docs/PersonResponseFilms.md +30 -0
- data/docs/PersonResponseSpouses.md +32 -0
- data/docs/PersonsApi.md +83 -0
- data/docs/PremiereResponse.md +20 -0
- data/docs/PremiereResponseItem.md +36 -0
- data/docs/RelatedFilmResponse.md +20 -0
- data/docs/RelatedFilmResponseItems.md +30 -0
- data/docs/ReviewDetailsResponse.md +32 -0
- data/docs/ReviewsApi.md +155 -0
- data/docs/ReviewsResponse.md +34 -0
- data/docs/ReviewsResponseReviews.md +32 -0
- data/docs/Season.md +20 -0
- data/docs/SeasonResponse.md +20 -0
- data/docs/StaffApi.md +147 -0
- data/docs/StaffResponse.md +30 -0
- data/docs/VideoResponse.md +20 -0
- data/docs/VideoResponseItems.md +22 -0
- data/kinopoiskapiunofficial-openapi.json +2918 -0
- data/kuapir.gemspec +42 -0
- data/lib/kuapir/api/films_api.rb +1193 -0
- data/lib/kuapir/api/persons_api.rb +89 -0
- data/lib/kuapir/api/reviews_api.rb +165 -0
- data/lib/kuapir/api/staff_api.rb +145 -0
- data/lib/kuapir/api_client.rb +390 -0
- data/lib/kuapir/api_error.rb +57 -0
- data/lib/kuapir/configuration.rb +287 -0
- data/lib/kuapir/models/box_office.rb +246 -0
- data/lib/kuapir/models/box_office_response.rb +224 -0
- data/lib/kuapir/models/company.rb +214 -0
- data/lib/kuapir/models/country.rb +214 -0
- data/lib/kuapir/models/digital_release_item.rb +334 -0
- data/lib/kuapir/models/digital_release_response.rb +232 -0
- data/lib/kuapir/models/distribution.rb +300 -0
- data/lib/kuapir/models/distribution_response.rb +224 -0
- data/lib/kuapir/models/episode.rb +249 -0
- data/lib/kuapir/models/fact.rb +266 -0
- data/lib/kuapir/models/fact_response.rb +224 -0
- data/lib/kuapir/models/film.rb +551 -0
- data/lib/kuapir/models/film_search_by_filters_response.rb +232 -0
- data/lib/kuapir/models/film_search_by_filters_response_items.rb +319 -0
- data/lib/kuapir/models/film_search_response.rb +244 -0
- data/lib/kuapir/models/film_search_response_films.rb +311 -0
- data/lib/kuapir/models/film_sequels_and_prequels_response.rb +300 -0
- data/lib/kuapir/models/film_top_response.rb +224 -0
- data/lib/kuapir/models/film_top_response_films.rb +272 -0
- data/lib/kuapir/models/filters_response.rb +226 -0
- data/lib/kuapir/models/filters_response_countries.rb +214 -0
- data/lib/kuapir/models/filters_response_genres.rb +214 -0
- data/lib/kuapir/models/genre.rb +214 -0
- data/lib/kuapir/models/image_response.rb +238 -0
- data/lib/kuapir/models/image_response_items.rb +214 -0
- data/lib/kuapir/models/person_by_name_response.rb +224 -0
- data/lib/kuapir/models/person_by_name_response_items.rb +274 -0
- data/lib/kuapir/models/person_response.rb +363 -0
- data/lib/kuapir/models/person_response_films.rb +284 -0
- data/lib/kuapir/models/person_response_spouses.rb +283 -0
- data/lib/kuapir/models/premiere_response.rb +224 -0
- data/lib/kuapir/models/premiere_response_item.rb +289 -0
- data/lib/kuapir/models/related_film_response.rb +224 -0
- data/lib/kuapir/models/related_film_response_items.rb +279 -0
- data/lib/kuapir/models/review_details_response.rb +314 -0
- data/lib/kuapir/models/reviews_response.rb +294 -0
- data/lib/kuapir/models/reviews_response_reviews.rb +282 -0
- data/lib/kuapir/models/season.rb +224 -0
- data/lib/kuapir/models/season_response.rb +224 -0
- data/lib/kuapir/models/staff_response.rb +301 -0
- data/lib/kuapir/models/video_response.rb +224 -0
- data/lib/kuapir/models/video_response_items.rb +255 -0
- data/lib/kuapir/version.rb +5 -0
- data/lib/kuapir.rb +83 -0
- data/openapi-generator-templates/Gemfile.mustache +9 -0
- data/openapi-generator-templates/README.mustache +148 -0
- data/openapi-generator-templates/Rakefile.mustache +10 -0
- data/openapi-generator-templates/api.mustache +205 -0
- data/openapi-generator-templates/api_client.mustache +260 -0
- data/openapi-generator-templates/api_client_faraday_partial.mustache +136 -0
- data/openapi-generator-templates/api_client_spec.mustache +216 -0
- data/openapi-generator-templates/api_client_typhoeus_partial.mustache +153 -0
- data/openapi-generator-templates/api_doc.mustache +118 -0
- data/openapi-generator-templates/api_error.mustache +45 -0
- data/openapi-generator-templates/api_info.mustache +12 -0
- data/openapi-generator-templates/api_test.mustache +43 -0
- data/openapi-generator-templates/base_object.mustache +120 -0
- data/openapi-generator-templates/configuration.mustache +381 -0
- data/openapi-generator-templates/configuration_spec.mustache +30 -0
- data/openapi-generator-templates/configuration_tls_faraday_partial.mustache +29 -0
- data/openapi-generator-templates/configuration_tls_typhoeus_partial.mustache +34 -0
- data/openapi-generator-templates/gem.mustache +50 -0
- data/openapi-generator-templates/gemspec.mustache +31 -0
- data/openapi-generator-templates/git_push.sh.mustache +57 -0
- data/openapi-generator-templates/gitignore.mustache +39 -0
- data/openapi-generator-templates/model.mustache +22 -0
- data/openapi-generator-templates/model_doc.mustache +12 -0
- data/openapi-generator-templates/model_test.mustache +73 -0
- data/openapi-generator-templates/partial_model_enum_class.mustache +20 -0
- data/openapi-generator-templates/partial_model_generic.mustache +371 -0
- data/openapi-generator-templates/partial_model_generic_doc.mustache +28 -0
- data/openapi-generator-templates/partial_oneof_module.mustache +137 -0
- data/openapi-generator-templates/partial_oneof_module_doc.mustache +92 -0
- data/openapi-generator-templates/rspec.mustache +2 -0
- data/openapi-generator-templates/rubocop.mustache +148 -0
- data/openapi-generator-templates/spec_helper.mustache +99 -0
- data/openapi-generator-templates/travis.mustache +14 -0
- data/openapi-generator-templates/version.mustache +3 -0
- data/openapitools.json +21 -0
- data/spec/api/films_api_spec.rb +227 -0
- data/spec/api/persons_api_spec.rb +45 -0
- data/spec/api/reviews_api_spec.rb +57 -0
- data/spec/api/staff_api_spec.rb +54 -0
- data/spec/api_client_spec.rb +229 -0
- data/spec/configuration_spec.rb +28 -0
- data/spec/models/box_office_response_spec.rb +37 -0
- data/spec/models/box_office_spec.rb +55 -0
- data/spec/models/company_spec.rb +31 -0
- data/spec/models/country_spec.rb +31 -0
- data/spec/models/digital_release_item_spec.rb +109 -0
- data/spec/models/digital_release_response_spec.rb +43 -0
- data/spec/models/distribution_response_spec.rb +37 -0
- data/spec/models/distribution_spec.rb +69 -0
- data/spec/models/episode_spec.rb +61 -0
- data/spec/models/fact_response_spec.rb +37 -0
- data/spec/models/fact_spec.rb +47 -0
- data/spec/models/film_search_by_filters_response_items_spec.rb +107 -0
- data/spec/models/film_search_by_filters_response_spec.rb +43 -0
- data/spec/models/film_search_response_films_spec.rb +107 -0
- data/spec/models/film_search_response_spec.rb +49 -0
- data/spec/models/film_sequels_and_prequels_response_spec.rb +71 -0
- data/spec/models/film_spec.rb +285 -0
- data/spec/models/film_top_response_films_spec.rb +91 -0
- data/spec/models/film_top_response_spec.rb +37 -0
- data/spec/models/filters_response_countries_spec.rb +37 -0
- data/spec/models/filters_response_genres_spec.rb +37 -0
- data/spec/models/filters_response_spec.rb +37 -0
- data/spec/models/genre_spec.rb +31 -0
- data/spec/models/image_response_items_spec.rb +37 -0
- data/spec/models/image_response_spec.rb +43 -0
- data/spec/models/person_by_name_response_items_spec.rb +65 -0
- data/spec/models/person_by_name_response_spec.rb +37 -0
- data/spec/models/person_response_films_spec.rb +71 -0
- data/spec/models/person_response_spec.rb +131 -0
- data/spec/models/person_response_spouses_spec.rb +77 -0
- data/spec/models/premiere_response_item_spec.rb +85 -0
- data/spec/models/premiere_response_spec.rb +37 -0
- data/spec/models/related_film_response_items_spec.rb +71 -0
- data/spec/models/related_film_response_spec.rb +37 -0
- data/spec/models/review_details_response_spec.rb +77 -0
- data/spec/models/reviews_response_reviews_spec.rb +77 -0
- data/spec/models/reviews_response_spec.rb +79 -0
- data/spec/models/season_response_spec.rb +37 -0
- data/spec/models/season_spec.rb +37 -0
- data/spec/models/staff_response_spec.rb +71 -0
- data/spec/models/video_response_items_spec.rb +47 -0
- data/spec/models/video_response_spec.rb +37 -0
- data/spec/spec_helper.rb +107 -0
- metadata +326 -0
@@ -0,0 +1,227 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# #Kinopoisk Unofficial API
|
4
|
+
|
5
|
+
# The version of the OpenAPI document: 2.0.1
|
6
|
+
# Contact: support@kinopoiskapiunofficial.tech
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# OpenAPI Generator version: 5.3.1
|
9
|
+
#
|
10
|
+
|
11
|
+
require "spec_helper"
|
12
|
+
require "json"
|
13
|
+
|
14
|
+
# Unit tests for Kuapir::FilmsApi
|
15
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
16
|
+
# Please update as you see appropriate
|
17
|
+
describe "FilmsApi" do
|
18
|
+
before do
|
19
|
+
# run before each test
|
20
|
+
@api_instance = Kuapir::FilmsApi.new
|
21
|
+
end
|
22
|
+
|
23
|
+
after do
|
24
|
+
# run after each test
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "test an instance of FilmsApi" do
|
28
|
+
it "should create an instance of FilmsApi" do
|
29
|
+
expect(@api_instance).to be_instance_of(Kuapir::FilmsApi)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# unit tests for api_v21_films_id_sequels_and_prequels_get
|
34
|
+
# получить сиквелы и приквелы для фильма по kinopoisk film id
|
35
|
+
# tbd
|
36
|
+
# @param id kinopoisk film id
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<FilmSequelsAndPrequelsResponse>]
|
39
|
+
describe "api_v21_films_id_sequels_and_prequels_get test" do
|
40
|
+
it "should work" do
|
41
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# unit tests for api_v21_films_releases_get
|
46
|
+
# получить список цифровых релизов
|
47
|
+
# Данный эндпоинт возвращает список цифровых релизов. Например https://www.kinopoisk.ru/comingsoon/digital/
|
48
|
+
# @param year год релиза
|
49
|
+
# @param month месяц релиза
|
50
|
+
# @param [Hash] opts the optional parameters
|
51
|
+
# @option opts [Integer] :page номер страницы
|
52
|
+
# @return [DigitalReleaseResponse]
|
53
|
+
describe "api_v21_films_releases_get test" do
|
54
|
+
it "should work" do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# unit tests for api_v21_films_search_by_keyword_get
|
60
|
+
# получить список фильмов по ключевым словам
|
61
|
+
# Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов.
|
62
|
+
# @param keyword ключивые слова для поиска
|
63
|
+
# @param [Hash] opts the optional parameters
|
64
|
+
# @option opts [Integer] :page номер страницы
|
65
|
+
# @return [FilmSearchResponse]
|
66
|
+
describe "api_v21_films_search_by_keyword_get test" do
|
67
|
+
it "should work" do
|
68
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# unit tests for api_v22_films_filters_get
|
73
|
+
# получить id стран и жанров для использования в /api/v2.2/films
|
74
|
+
# Возвращает список id стран и жанров, которые могут быть использованы в /api/v2.2/films
|
75
|
+
# @param [Hash] opts the optional parameters
|
76
|
+
# @return [FiltersResponse]
|
77
|
+
describe "api_v22_films_filters_get test" do
|
78
|
+
it "should work" do
|
79
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# unit tests for api_v22_films_get
|
84
|
+
# получить список фильмов по различным фильтрам
|
85
|
+
# Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов. Данный эндпоинт не возращает более 400 фильмов. <i>Используй /api/v2.2/films/filters чтобы получить id стран и жанров.</i>
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @option opts [Array<Integer>] :countries список id стран разделенные запятой. Например <i>countries=1,2,3</i>. На данный момент можно указать не более одной страны.
|
88
|
+
# @option opts [Array<Integer>] :genres список id жанров разделенные запятой. Например <i>genres=1,2,3</i>. На данный момент можно указать не более одного жанра.
|
89
|
+
# @option opts [String] :order сортировка
|
90
|
+
# @option opts [String] :type тип фильма
|
91
|
+
# @option opts [Integer] :rating_from минимальный рейтинг
|
92
|
+
# @option opts [Integer] :rating_to максимальный рейтинг
|
93
|
+
# @option opts [Integer] :year_from минимальный год
|
94
|
+
# @option opts [Integer] :year_to максимальный год
|
95
|
+
# @option opts [String] :imdb_id imdb id
|
96
|
+
# @option opts [String] :keyword ключевое слово, которое встречается в названии фильма
|
97
|
+
# @option opts [Integer] :page номер страницы
|
98
|
+
# @return [FilmSearchByFiltersResponse]
|
99
|
+
describe "api_v22_films_get test" do
|
100
|
+
it "should work" do
|
101
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# unit tests for api_v22_films_id_box_office_get
|
106
|
+
# получить данные о бюджете и сборах фильма по kinopoisk film id
|
107
|
+
# Данный эндпоинт возвращает данные о бюджете и сборах.
|
108
|
+
# @param id kinopoisk film id
|
109
|
+
# @param [Hash] opts the optional parameters
|
110
|
+
# @return [BoxOfficeResponse]
|
111
|
+
describe "api_v22_films_id_box_office_get test" do
|
112
|
+
it "should work" do
|
113
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# unit tests for api_v22_films_id_distributions_get
|
118
|
+
# получить данные о прокате фильма по kinopoisk film id
|
119
|
+
# Данный эндпоинт возвращает данные о прокате в разных странах.
|
120
|
+
# @param id kinopoisk film id
|
121
|
+
# @param [Hash] opts the optional parameters
|
122
|
+
# @return [DistributionResponse]
|
123
|
+
describe "api_v22_films_id_distributions_get test" do
|
124
|
+
it "should work" do
|
125
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# unit tests for api_v22_films_id_facts_get
|
130
|
+
# получить данные о фактах и ошибках в фильме по kinopoisk film id
|
131
|
+
# Данный эндпоинт возвращает список фактов и ошибок в фильме. <br> type - <b>FACT</b>, обозначает интересный факт о фильме. <br> type - <b>BLOOPER</b>, обозначает ошибку в фильме.
|
132
|
+
# @param id kinopoisk film id
|
133
|
+
# @param [Hash] opts the optional parameters
|
134
|
+
# @return [FactResponse]
|
135
|
+
describe "api_v22_films_id_facts_get test" do
|
136
|
+
it "should work" do
|
137
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# unit tests for api_v22_films_id_get
|
142
|
+
# получить данные о фильме по kinopoisk id
|
143
|
+
# Данный эндпоинт возвращает базовые данные о фильме. Поле <b>lastSync</b> показывает дату последнего обновления данных.
|
144
|
+
# @param id kinopoisk film id
|
145
|
+
# @param [Hash] opts the optional parameters
|
146
|
+
# @return [Film]
|
147
|
+
describe "api_v22_films_id_get test" do
|
148
|
+
it "should work" do
|
149
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# unit tests for api_v22_films_id_images_get
|
154
|
+
# получить изображения(кадры, постеры, фан-арты, обои и т.д.) связанные с фильмом по kinopoisk film id
|
155
|
+
# Данный эндпоинт возвращает изображения связанные с фильмом с пагинацией. Каждая страница содержит <b>не более чем 20 фильмов</b>.</br> Доступные изображения:</br> <ul> <li>STILL - кадры</li> <li>SHOOTING - изображения со съемок</li> <li>POSTER - постеры</li> <li>FAN_ART - фан-арты</li> <li>PROMO - промо</li> <li>CONCEPT - концепт-арты</li> <li>WALLPAPER - обои</li> <li>COVER - обложки</li> <li>SCREENSHOT - скриншоты</li> </ul>
|
156
|
+
# @param id kinopoisk film id
|
157
|
+
# @param [Hash] opts the optional parameters
|
158
|
+
# @option opts [String] :type тип изображения
|
159
|
+
# @option opts [Integer] :page номер страницы
|
160
|
+
# @return [ImageResponse]
|
161
|
+
describe "api_v22_films_id_images_get test" do
|
162
|
+
it "should work" do
|
163
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# unit tests for api_v22_films_id_seasons_get
|
168
|
+
# получить данные о сезонах для сериала по kinopoisk film id
|
169
|
+
# Данный эндпоинт возвращает данные о сезонах для сериала.
|
170
|
+
# @param id kinopoisk film id
|
171
|
+
# @param [Hash] opts the optional parameters
|
172
|
+
# @return [SeasonResponse]
|
173
|
+
describe "api_v22_films_id_seasons_get test" do
|
174
|
+
it "should work" do
|
175
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# unit tests for api_v22_films_id_similars_get
|
180
|
+
# получить список похожих фильмов по kinopoisk film id
|
181
|
+
# @param id kinopoisk film id
|
182
|
+
# @param [Hash] opts the optional parameters
|
183
|
+
# @return [RelatedFilmResponse]
|
184
|
+
describe "api_v22_films_id_similars_get test" do
|
185
|
+
it "should work" do
|
186
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# unit tests for api_v22_films_id_videos_get
|
191
|
+
# получить трейлеры,тизеры,видео для фильма по kinopoisk film id
|
192
|
+
# Данный эндпоинт возвращает трейлеры,тизеры,видео для фильма по kinopoisk film id. В данный момент доступно два site: <br/> <ul><li>YOUTUBE - в этом случае <b>url</b> это просто ссылка на youtube видео.</li><li>KINOPOISK_WIDGET - в этом случае <b>url</b> это ссылка на кинопоиск виджет. Например https://widgets.kinopoisk.ru/discovery/trailer/123573?onlyPlayer=1&autoplay=1&cover=1. Если вы хотите вставить этот виджет на вашу страницу, вы можете сделать следующее: <br/><br/>&lt;script src=&quot;https://unpkg.com/@ungap/custom-elements-builtin&quot;&gt;&lt;/script&gt;<br/>&lt;script type=&quot;module&quot; src=&quot;https://unpkg.com/x-frame-bypass&quot;&gt;&lt;/script&gt;<br/>&lt;iframe is=&quot;x-frame-bypass&quot; src=&quot;https://widgets.kinopoisk.ru/discovery/trailer/167560?onlyPlayer=1&amp;autoplay=1&amp;cover=1&quot; width=&quot;500&quot; height=&quot;500&quot;&gt;&lt;/iframe&gt;</li></ul>
|
193
|
+
# @param id kinopoisk film id
|
194
|
+
# @param [Hash] opts the optional parameters
|
195
|
+
# @return [VideoResponse]
|
196
|
+
describe "api_v22_films_id_videos_get test" do
|
197
|
+
it "should work" do
|
198
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
# unit tests for api_v22_films_premieres_get
|
203
|
+
# получить список кинопремьер
|
204
|
+
# Данный эндпоинт возвращает список кинопремьер. Например https://www.kinopoisk.ru/premiere/
|
205
|
+
# @param year год релиза
|
206
|
+
# @param month месяц релиза
|
207
|
+
# @param [Hash] opts the optional parameters
|
208
|
+
# @return [PremiereResponse]
|
209
|
+
describe "api_v22_films_premieres_get test" do
|
210
|
+
it "should work" do
|
211
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
# unit tests for api_v22_films_top_get
|
216
|
+
# получить список фильмов из различных топов или коллекций. Например https://www.kinopoisk.ru/top/lists/58/
|
217
|
+
# Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов.
|
218
|
+
# @param [Hash] opts the optional parameters
|
219
|
+
# @option opts [String] :type тип топа или коллекции
|
220
|
+
# @option opts [Integer] :page номер страницы
|
221
|
+
# @return [FilmTopResponse]
|
222
|
+
describe "api_v22_films_top_get test" do
|
223
|
+
it "should work" do
|
224
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# #Kinopoisk Unofficial API
|
4
|
+
|
5
|
+
# The version of the OpenAPI document: 2.0.1
|
6
|
+
# Contact: support@kinopoiskapiunofficial.tech
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# OpenAPI Generator version: 5.3.1
|
9
|
+
#
|
10
|
+
|
11
|
+
require "spec_helper"
|
12
|
+
require "json"
|
13
|
+
|
14
|
+
# Unit tests for Kuapir::PersonsApi
|
15
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
16
|
+
# Please update as you see appropriate
|
17
|
+
describe "PersonsApi" do
|
18
|
+
before do
|
19
|
+
# run before each test
|
20
|
+
@api_instance = Kuapir::PersonsApi.new
|
21
|
+
end
|
22
|
+
|
23
|
+
after do
|
24
|
+
# run after each test
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "test an instance of PersonsApi" do
|
28
|
+
it "should create an instance of PersonsApi" do
|
29
|
+
expect(@api_instance).to be_instance_of(Kuapir::PersonsApi)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# unit tests for api_v1_persons_get
|
34
|
+
# поиск актеров, режиссеров и т.д. по имени
|
35
|
+
# Одна страница может содержать до 50 элементов в items.
|
36
|
+
# @param name имя человека
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [Integer] :page номер страницы
|
39
|
+
# @return [PersonByNameResponse]
|
40
|
+
describe "api_v1_persons_get test" do
|
41
|
+
it "should work" do
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# #Kinopoisk Unofficial API
|
4
|
+
|
5
|
+
# The version of the OpenAPI document: 2.0.1
|
6
|
+
# Contact: support@kinopoiskapiunofficial.tech
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# OpenAPI Generator version: 5.3.1
|
9
|
+
#
|
10
|
+
|
11
|
+
require "spec_helper"
|
12
|
+
require "json"
|
13
|
+
|
14
|
+
# Unit tests for Kuapir::ReviewsApi
|
15
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
16
|
+
# Please update as you see appropriate
|
17
|
+
describe "ReviewsApi" do
|
18
|
+
before do
|
19
|
+
# run before each test
|
20
|
+
@api_instance = Kuapir::ReviewsApi.new
|
21
|
+
end
|
22
|
+
|
23
|
+
after do
|
24
|
+
# run after each test
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "test an instance of ReviewsApi" do
|
28
|
+
it "should create an instance of ReviewsApi" do
|
29
|
+
expect(@api_instance).to be_instance_of(Kuapir::ReviewsApi)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# unit tests for api_v1_reviews_details_get
|
34
|
+
# получить полную рецензию по kinopoisk review id
|
35
|
+
# Возвращает полную информацию о рецензии.
|
36
|
+
# @param review_id kinopoisk review id
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [ReviewDetailsResponse]
|
39
|
+
describe "api_v1_reviews_details_get test" do
|
40
|
+
it "should work" do
|
41
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# unit tests for api_v1_reviews_get
|
46
|
+
# получить рецензии зрителей
|
47
|
+
# Возвращает список рецензий с пагинацией. Каждая страница содержит не более чем 20 рецензий. Поле <b>description</b> содержит не полный текст рецензии. Полный текст может быть получен из /api/v1/reviews/details
|
48
|
+
# @param film_id kinopoisk film id
|
49
|
+
# @param [Hash] opts the optional parameters
|
50
|
+
# @option opts [Integer] :page номер страницы
|
51
|
+
# @return [ReviewsResponse]
|
52
|
+
describe "api_v1_reviews_get test" do
|
53
|
+
it "should work" do
|
54
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# #Kinopoisk Unofficial API
|
4
|
+
|
5
|
+
# The version of the OpenAPI document: 2.0.1
|
6
|
+
# Contact: support@kinopoiskapiunofficial.tech
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# OpenAPI Generator version: 5.3.1
|
9
|
+
#
|
10
|
+
|
11
|
+
require "spec_helper"
|
12
|
+
require "json"
|
13
|
+
|
14
|
+
# Unit tests for Kuapir::StaffApi
|
15
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
16
|
+
# Please update as you see appropriate
|
17
|
+
describe "StaffApi" do
|
18
|
+
before do
|
19
|
+
# run before each test
|
20
|
+
@api_instance = Kuapir::StaffApi.new
|
21
|
+
end
|
22
|
+
|
23
|
+
after do
|
24
|
+
# run after each test
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "test an instance of StaffApi" do
|
28
|
+
it "should create an instance of StaffApi" do
|
29
|
+
expect(@api_instance).to be_instance_of(Kuapir::StaffApi)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# unit tests for api_v1_staff_get
|
34
|
+
# получить данные об актерах, режисерах и т.д. по kinopoisk film id
|
35
|
+
# @param film_id kinopoisk film id
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<StaffResponse>]
|
38
|
+
describe "api_v1_staff_get test" do
|
39
|
+
it "should work" do
|
40
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# unit tests for api_v1_staff_id_get
|
45
|
+
# получить данные о конкретном человеке по kinopoisk person id
|
46
|
+
# @param id kinopoisk person id
|
47
|
+
# @param [Hash] opts the optional parameters
|
48
|
+
# @return [PersonResponse]
|
49
|
+
describe "api_v1_staff_id_get test" do
|
50
|
+
it "should work" do
|
51
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# #Kinopoisk Unofficial API
|
4
|
+
|
5
|
+
# The version of the OpenAPI document: 2.0.1
|
6
|
+
# Contact: support@kinopoiskapiunofficial.tech
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# OpenAPI Generator version: 5.3.1
|
9
|
+
#
|
10
|
+
|
11
|
+
require "spec_helper"
|
12
|
+
|
13
|
+
describe Kuapir::ApiClient do
|
14
|
+
context "initialization" do
|
15
|
+
context "URL stuff" do
|
16
|
+
context "host" do
|
17
|
+
it "removes http from host" do
|
18
|
+
Kuapir.configure { |c| c.host = "http://example.com" }
|
19
|
+
expect(Kuapir::Configuration.default.host).to eq("example.com")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "removes https from host" do
|
23
|
+
Kuapir.configure { |c| c.host = "https://wookiee.com" }
|
24
|
+
expect(Kuapir::ApiClient.default.config.host).to eq("wookiee.com")
|
25
|
+
end
|
26
|
+
|
27
|
+
it "removes trailing path from host" do
|
28
|
+
Kuapir.configure { |c| c.host = "hobo.com/v4" }
|
29
|
+
expect(Kuapir::Configuration.default.host).to eq("hobo.com")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "base_path" do
|
34
|
+
it "prepends a slash to base_path" do
|
35
|
+
Kuapir.configure { |c| c.base_path = "v4/dog" }
|
36
|
+
expect(Kuapir::Configuration.default.base_path).to eq("/v4/dog")
|
37
|
+
end
|
38
|
+
|
39
|
+
it "doesn't prepend a slash if one is already there" do
|
40
|
+
Kuapir.configure { |c| c.base_path = "/v4/dog" }
|
41
|
+
expect(Kuapir::Configuration.default.base_path).to eq("/v4/dog")
|
42
|
+
end
|
43
|
+
|
44
|
+
it "ends up as a blank string if nil" do
|
45
|
+
Kuapir.configure { |c| c.base_path = nil }
|
46
|
+
expect(Kuapir::Configuration.default.base_path).to eq("")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "params_encoding in #build_request" do
|
53
|
+
let(:config) { Kuapir::Configuration.new }
|
54
|
+
let(:api_client) { Kuapir::ApiClient.new(config) }
|
55
|
+
|
56
|
+
it "defaults to nil" do
|
57
|
+
expect(Kuapir::Configuration.default.params_encoding).to eq(nil)
|
58
|
+
expect(config.params_encoding).to eq(nil)
|
59
|
+
|
60
|
+
request = api_client.build_request(:get, "/test")
|
61
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "can be customized" do
|
65
|
+
config.params_encoding = :multi
|
66
|
+
request = api_client.build_request(:get, "/test")
|
67
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "timeout in #build_request" do
|
72
|
+
let(:config) { Kuapir::Configuration.new }
|
73
|
+
let(:api_client) { Kuapir::ApiClient.new(config) }
|
74
|
+
|
75
|
+
it "defaults to 0" do
|
76
|
+
expect(Kuapir::Configuration.default.timeout).to eq(0)
|
77
|
+
expect(config.timeout).to eq(0)
|
78
|
+
|
79
|
+
request = api_client.build_request(:get, "/test")
|
80
|
+
expect(request.options[:timeout]).to eq(0)
|
81
|
+
end
|
82
|
+
|
83
|
+
it "can be customized" do
|
84
|
+
config.timeout = 100
|
85
|
+
request = api_client.build_request(:get, "/test")
|
86
|
+
expect(request.options[:timeout]).to eq(100)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "#deserialize" do
|
91
|
+
it "handles Array<Integer>" do
|
92
|
+
api_client = Kuapir::ApiClient.new
|
93
|
+
headers = { "Content-Type" => "application/json" }
|
94
|
+
response = double("response", headers: headers, body: "[12, 34]")
|
95
|
+
data = api_client.deserialize(response, "Array<Integer>")
|
96
|
+
expect(data).to be_instance_of(Array)
|
97
|
+
expect(data).to eq([12, 34])
|
98
|
+
end
|
99
|
+
|
100
|
+
it "handles Array<Array<Integer>>" do
|
101
|
+
api_client = Kuapir::ApiClient.new
|
102
|
+
headers = { "Content-Type" => "application/json" }
|
103
|
+
response = double("response", headers: headers, body: "[[12, 34], [56]]")
|
104
|
+
data = api_client.deserialize(response, "Array<Array<Integer>>")
|
105
|
+
expect(data).to be_instance_of(Array)
|
106
|
+
expect(data).to eq([[12, 34], [56]])
|
107
|
+
end
|
108
|
+
|
109
|
+
it "handles Hash<String, String>" do
|
110
|
+
api_client = Kuapir::ApiClient.new
|
111
|
+
headers = { "Content-Type" => "application/json" }
|
112
|
+
response = double("response", headers: headers, body: '{"message": "Hello"}')
|
113
|
+
data = api_client.deserialize(response, "Hash<String, String>")
|
114
|
+
expect(data).to be_instance_of(Hash)
|
115
|
+
expect(data).to eq(message: "Hello")
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe "#object_to_hash" do
|
120
|
+
it "ignores nils and includes empty arrays" do
|
121
|
+
# uncomment below to test object_to_hash for model
|
122
|
+
# api_client = Kuapir::ApiClient.new
|
123
|
+
# _model = Kuapir::ModelName.new
|
124
|
+
# update the model attribute below
|
125
|
+
# _model.id = 1
|
126
|
+
# update the expected value (hash) below
|
127
|
+
# expected = {id: 1, name: '', tags: []}
|
128
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
describe "#build_collection_param" do
|
133
|
+
let(:param) { %w[aa bb cc] }
|
134
|
+
let(:api_client) { Kuapir::ApiClient.new }
|
135
|
+
|
136
|
+
it "works for csv" do
|
137
|
+
expect(api_client.build_collection_param(param, :csv)).to eq("aa,bb,cc")
|
138
|
+
end
|
139
|
+
|
140
|
+
it "works for ssv" do
|
141
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq("aa bb cc")
|
142
|
+
end
|
143
|
+
|
144
|
+
it "works for tsv" do
|
145
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
146
|
+
end
|
147
|
+
|
148
|
+
it "works for pipes" do
|
149
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq("aa|bb|cc")
|
150
|
+
end
|
151
|
+
|
152
|
+
it "works for multi" do
|
153
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(%w[aa bb cc])
|
154
|
+
end
|
155
|
+
|
156
|
+
it "fails for invalid collection format" do
|
157
|
+
expect do
|
158
|
+
api_client.build_collection_param(param,
|
159
|
+
:INVALID)
|
160
|
+
end.to raise_error(RuntimeError, "unknown collection format: :INVALID")
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
describe "#json_mime?" do
|
165
|
+
let(:api_client) { Kuapir::ApiClient.new }
|
166
|
+
|
167
|
+
it "works" do
|
168
|
+
expect(api_client.json_mime?(nil)).to eq false
|
169
|
+
expect(api_client.json_mime?("")).to eq false
|
170
|
+
|
171
|
+
expect(api_client.json_mime?("application/json")).to eq true
|
172
|
+
expect(api_client.json_mime?("application/json; charset=UTF8")).to eq true
|
173
|
+
expect(api_client.json_mime?("APPLICATION/JSON")).to eq true
|
174
|
+
|
175
|
+
expect(api_client.json_mime?("application/xml")).to eq false
|
176
|
+
expect(api_client.json_mime?("text/plain")).to eq false
|
177
|
+
expect(api_client.json_mime?("application/jsonp")).to eq false
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
describe "#select_header_accept" do
|
182
|
+
let(:api_client) { Kuapir::ApiClient.new }
|
183
|
+
|
184
|
+
it "works" do
|
185
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
186
|
+
expect(api_client.select_header_accept([])).to be_nil
|
187
|
+
|
188
|
+
expect(api_client.select_header_accept(["application/json"])).to eq("application/json")
|
189
|
+
expect(api_client.select_header_accept(["application/xml",
|
190
|
+
"application/json; charset=UTF8"])).to eq("application/json; charset=UTF8")
|
191
|
+
expect(api_client.select_header_accept(["APPLICATION/JSON", "text/html"])).to eq("APPLICATION/JSON")
|
192
|
+
|
193
|
+
expect(api_client.select_header_accept(["application/xml"])).to eq("application/xml")
|
194
|
+
expect(api_client.select_header_accept(["text/html", "application/xml"])).to eq("text/html,application/xml")
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
describe "#select_header_content_type" do
|
199
|
+
let(:api_client) { Kuapir::ApiClient.new }
|
200
|
+
|
201
|
+
it "works" do
|
202
|
+
expect(api_client.select_header_content_type(nil)).to be_nil
|
203
|
+
expect(api_client.select_header_content_type([])).to be_nil
|
204
|
+
|
205
|
+
expect(api_client.select_header_content_type(["application/json"])).to eq("application/json")
|
206
|
+
expect(api_client.select_header_content_type(["application/xml",
|
207
|
+
"application/json; charset=UTF8"])).to eq("application/json; charset=UTF8")
|
208
|
+
expect(api_client.select_header_content_type(["APPLICATION/JSON", "text/html"])).to eq("APPLICATION/JSON")
|
209
|
+
expect(api_client.select_header_content_type(["application/xml"])).to eq("application/xml")
|
210
|
+
expect(api_client.select_header_content_type(["text/plain", "application/xml"])).to eq("text/plain")
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
describe "#sanitize_filename" do
|
215
|
+
let(:api_client) { Kuapir::ApiClient.new }
|
216
|
+
|
217
|
+
it "works" do
|
218
|
+
expect(api_client.sanitize_filename("sun")).to eq("sun")
|
219
|
+
expect(api_client.sanitize_filename("sun.gif")).to eq("sun.gif")
|
220
|
+
expect(api_client.sanitize_filename("../sun.gif")).to eq("sun.gif")
|
221
|
+
expect(api_client.sanitize_filename("/var/tmp/sun.gif")).to eq("sun.gif")
|
222
|
+
expect(api_client.sanitize_filename("./sun.gif")).to eq("sun.gif")
|
223
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq("sun.gif")
|
224
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq("sun.gif")
|
225
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq("sun.gif")
|
226
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq("sun.gif")
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# #Kinopoisk Unofficial API
|
4
|
+
|
5
|
+
# The version of the OpenAPI document: 2.0.1
|
6
|
+
# Contact: support@kinopoiskapiunofficial.tech
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# OpenAPI Generator version: 5.3.1
|
9
|
+
#
|
10
|
+
|
11
|
+
require "spec_helper"
|
12
|
+
|
13
|
+
describe Kuapir::Configuration do
|
14
|
+
let(:config) { Kuapir::Configuration.default }
|
15
|
+
|
16
|
+
describe "#base_url" do
|
17
|
+
it "should have the default value" do
|
18
|
+
expect(config.base_url).to eq("https://kinopoiskapiunofficial.tech")
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should remove trailing slashes" do
|
22
|
+
[nil, "", "/", "//"].each do |base_path|
|
23
|
+
config.base_path = base_path
|
24
|
+
expect(config.base_url).to eq("https://kinopoiskapiunofficial.tech")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|