pulp_gem_client 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -8
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentGemApi.md +118 -66
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/DistributionsGemApi.md +388 -183
- data/docs/GemGemContentResponse.md +32 -29
- data/docs/GemGemDistribution.md +22 -21
- data/docs/GemGemDistributionResponse.md +34 -29
- data/docs/GemGemPublication.md +10 -9
- data/docs/GemGemPublicationResponse.md +18 -15
- data/docs/GemGemRemote.md +54 -53
- data/docs/GemGemRemoteResponse.md +54 -51
- data/docs/GemGemRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/GemGemRepository.md +16 -15
- data/docs/GemGemRepositoryResponse.md +28 -25
- data/docs/MyPermissionsResponse.md +8 -7
- data/docs/NestedRole.md +12 -11
- data/docs/NestedRoleResponse.md +12 -11
- data/docs/ObjectRolesResponse.md +8 -7
- data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
- data/docs/PaginatedgemGemContentResponseList.md +14 -13
- data/docs/PaginatedgemGemDistributionResponseList.md +14 -13
- data/docs/PaginatedgemGemPublicationResponseList.md +14 -13
- data/docs/PaginatedgemGemRemoteResponseList.md +14 -13
- data/docs/PaginatedgemGemRepositoryResponseList.md +14 -13
- data/docs/PatchedgemGemDistribution.md +22 -21
- data/docs/PatchedgemGemRemote.md +54 -53
- data/docs/PatchedgemGemRepository.md +16 -15
- data/docs/PolicyEnum.md +4 -5
- data/docs/PublicationsGemApi.md +271 -132
- data/docs/RemotesGemApi.md +392 -185
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesGemApi.md +449 -210
- data/docs/RepositoriesGemVersionsApi.md +155 -83
- data/docs/RepositoryAddRemoveContent.md +12 -11
- data/docs/RepositorySyncURL.md +10 -9
- data/docs/RepositoryVersionResponse.md +22 -19
- data/docs/SetLabel.md +10 -9
- data/docs/SetLabelResponse.md +10 -9
- data/docs/UnsetLabel.md +8 -7
- data/docs/UnsetLabelResponse.md +10 -9
- data/lib/pulp_gem_client/api/content_gem_api.rb +31 -22
- data/lib/pulp_gem_client/api/distributions_gem_api.rb +94 -58
- data/lib/pulp_gem_client/api/publications_gem_api.rb +81 -58
- data/lib/pulp_gem_client/api/remotes_gem_api.rb +109 -70
- data/lib/pulp_gem_client/api/repositories_gem_api.rb +116 -72
- data/lib/pulp_gem_client/api/repositories_gem_versions_api.rb +50 -37
- data/lib/pulp_gem_client/api_client.rb +137 -102
- data/lib/pulp_gem_client/api_error.rb +2 -1
- data/lib/pulp_gem_client/configuration.rb +162 -21
- data/lib/pulp_gem_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_gem_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_gem_client/models/gem_gem_content_response.rb +45 -25
- data/lib/pulp_gem_client/models/gem_gem_distribution.rb +34 -22
- data/lib/pulp_gem_client/models/gem_gem_distribution_response.rb +57 -25
- data/lib/pulp_gem_client/models/gem_gem_publication.rb +30 -22
- data/lib/pulp_gem_client/models/gem_gem_publication_response.rb +43 -25
- data/lib/pulp_gem_client/models/gem_gem_remote.rb +56 -22
- data/lib/pulp_gem_client/models/gem_gem_remote_response.rb +70 -26
- data/lib/pulp_gem_client/models/{gem_gem_remote_response_hidden_fields.rb → gem_gem_remote_response_hidden_fields_inner.rb} +37 -25
- data/lib/pulp_gem_client/models/gem_gem_repository.rb +32 -22
- data/lib/pulp_gem_client/models/gem_gem_repository_response.rb +45 -25
- data/lib/pulp_gem_client/models/my_permissions_response.rb +32 -22
- data/lib/pulp_gem_client/models/nested_role.rb +32 -22
- data/lib/pulp_gem_client/models/nested_role_response.rb +32 -22
- data/lib/pulp_gem_client/models/object_roles_response.rb +32 -22
- data/lib/pulp_gem_client/models/paginated_repository_version_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_content_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_distribution_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_publication_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_remote_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/paginatedgem_gem_repository_response_list.rb +34 -22
- data/lib/pulp_gem_client/models/patchedgem_gem_distribution.rb +40 -24
- data/lib/pulp_gem_client/models/patchedgem_gem_remote.rb +62 -24
- data/lib/pulp_gem_client/models/patchedgem_gem_repository.rb +35 -23
- data/lib/pulp_gem_client/models/policy_enum.rb +8 -4
- data/lib/pulp_gem_client/models/repair.rb +30 -22
- data/lib/pulp_gem_client/models/repository_add_remove_content.rb +31 -23
- data/lib/pulp_gem_client/models/repository_sync_url.rb +30 -22
- data/lib/pulp_gem_client/models/repository_version_response.rb +44 -26
- data/lib/pulp_gem_client/models/set_label.rb +34 -22
- data/lib/pulp_gem_client/models/set_label_response.rb +34 -22
- data/lib/pulp_gem_client/models/unset_label.rb +32 -22
- data/lib/pulp_gem_client/models/unset_label_response.rb +32 -22
- data/lib/pulp_gem_client/version.rb +2 -2
- data/lib/pulp_gem_client.rb +2 -3
- data/pulp_gem_client.gemspec +9 -6
- data/spec/api/content_gem_api_spec.rb +9 -8
- data/spec/api/distributions_gem_api_spec.rb +15 -14
- data/spec/api/publications_gem_api_spec.rb +22 -20
- data/spec/api/remotes_gem_api_spec.rb +22 -20
- data/spec/api/repositories_gem_api_spec.rb +19 -18
- data/spec/api/repositories_gem_versions_api_spec.rb +16 -14
- data/spec/models/async_operation_response_spec.rb +7 -12
- data/spec/models/content_summary_response_spec.rb +9 -14
- data/spec/models/gem_gem_content_response_spec.rb +24 -23
- data/spec/models/gem_gem_distribution_response_spec.rb +30 -23
- data/spec/models/gem_gem_distribution_spec.rb +14 -19
- data/spec/models/gem_gem_publication_response_spec.rb +17 -16
- data/spec/models/gem_gem_publication_spec.rb +8 -13
- data/spec/models/{gem_gem_remote_response_hidden_fields_spec.rb → gem_gem_remote_response_hidden_fields_inner_spec.rb} +11 -16
- data/spec/models/gem_gem_remote_response_spec.rb +35 -34
- data/spec/models/gem_gem_remote_spec.rb +30 -35
- data/spec/models/gem_gem_repository_response_spec.rb +22 -21
- data/spec/models/gem_gem_repository_spec.rb +11 -16
- data/spec/models/my_permissions_response_spec.rb +7 -12
- data/spec/models/nested_role_response_spec.rb +9 -14
- data/spec/models/nested_role_spec.rb +9 -14
- data/spec/models/object_roles_response_spec.rb +7 -12
- data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_content_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_publication_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedgem_gem_repository_response_list_spec.rb +10 -15
- data/spec/models/patchedgem_gem_distribution_spec.rb +14 -19
- data/spec/models/patchedgem_gem_remote_spec.rb +30 -35
- data/spec/models/patchedgem_gem_repository_spec.rb +11 -16
- data/spec/models/policy_enum_spec.rb +6 -11
- data/spec/models/repair_spec.rb +7 -12
- data/spec/models/repository_add_remove_content_spec.rb +9 -14
- data/spec/models/repository_sync_url_spec.rb +8 -13
- data/spec/models/repository_version_response_spec.rb +19 -18
- data/spec/models/set_label_response_spec.rb +8 -13
- data/spec/models/set_label_spec.rb +8 -13
- data/spec/models/unset_label_response_spec.rb +8 -13
- data/spec/models/unset_label_spec.rb +7 -12
- data/spec/spec_helper.rb +1 -1
- metadata +80 -60
- data/docs/GemGemContent.md +0 -21
- data/docs/GemGemRemoteResponseHiddenFields.md +0 -19
- data/lib/pulp_gem_client/models/gem_gem_content.rb +0 -228
- data/spec/api_client_spec.rb +0 -188
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/gem_gem_content_spec.rb +0 -53
data/spec/api_client_spec.rb
DELETED
@@ -1,188 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Pulp 3 API
|
3
|
-
|
4
|
-
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v3
|
7
|
-
Contact: pulp-list@redhat.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
|
15
|
-
describe PulpGemClient::ApiClient do
|
16
|
-
context 'initialization' do
|
17
|
-
context 'URL stuff' do
|
18
|
-
context 'host' do
|
19
|
-
it 'removes http from host' do
|
20
|
-
PulpGemClient.configure { |c| c.host = 'http://example.com' }
|
21
|
-
expect(PulpGemClient::Configuration.default.host).to eq('example.com')
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'removes https from host' do
|
25
|
-
PulpGemClient.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
-
expect(PulpGemClient::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'removes trailing path from host' do
|
30
|
-
PulpGemClient.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
-
expect(PulpGemClient::Configuration.default.host).to eq('hobo.com')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'base_path' do
|
36
|
-
it "prepends a slash to base_path" do
|
37
|
-
PulpGemClient.configure { |c| c.base_path = 'v4/dog' }
|
38
|
-
expect(PulpGemClient::Configuration.default.base_path).to eq('/v4/dog')
|
39
|
-
end
|
40
|
-
|
41
|
-
it "doesn't prepend a slash if one is already there" do
|
42
|
-
PulpGemClient.configure { |c| c.base_path = '/v4/dog' }
|
43
|
-
expect(PulpGemClient::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
-
end
|
45
|
-
|
46
|
-
it "ends up as a blank string if nil" do
|
47
|
-
PulpGemClient.configure { |c| c.base_path = nil }
|
48
|
-
expect(PulpGemClient::Configuration.default.base_path).to eq('')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe '#deserialize' do
|
55
|
-
it "handles Array<Integer>" do
|
56
|
-
api_client = PulpGemClient::ApiClient.new
|
57
|
-
headers = { 'Content-Type' => 'application/json' }
|
58
|
-
response = double('response', headers: headers, body: '[12, 34]')
|
59
|
-
data = api_client.deserialize(response, 'Array<Integer>')
|
60
|
-
expect(data).to be_instance_of(Array)
|
61
|
-
expect(data).to eq([12, 34])
|
62
|
-
end
|
63
|
-
|
64
|
-
it 'handles Array<Array<Integer>>' do
|
65
|
-
api_client = PulpGemClient::ApiClient.new
|
66
|
-
headers = { 'Content-Type' => 'application/json' }
|
67
|
-
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
68
|
-
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
69
|
-
expect(data).to be_instance_of(Array)
|
70
|
-
expect(data).to eq([[12, 34], [56]])
|
71
|
-
end
|
72
|
-
|
73
|
-
it 'handles Hash<String, String>' do
|
74
|
-
api_client = PulpGemClient::ApiClient.new
|
75
|
-
headers = { 'Content-Type' => 'application/json' }
|
76
|
-
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
77
|
-
data = api_client.deserialize(response, 'Hash<String, String>')
|
78
|
-
expect(data).to be_instance_of(Hash)
|
79
|
-
expect(data).to eq(:message => 'Hello')
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe "#object_to_hash" do
|
84
|
-
it 'ignores nils and includes empty arrays' do
|
85
|
-
# uncomment below to test object_to_hash for model
|
86
|
-
# api_client = PulpGemClient::ApiClient.new
|
87
|
-
# _model = PulpGemClient::ModelName.new
|
88
|
-
# update the model attribute below
|
89
|
-
# _model.id = 1
|
90
|
-
# update the expected value (hash) below
|
91
|
-
# expected = {id: 1, name: '', tags: []}
|
92
|
-
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
describe '#build_collection_param' do
|
97
|
-
let(:param) { ['aa', 'bb', 'cc'] }
|
98
|
-
let(:api_client) { PulpGemClient::ApiClient.new }
|
99
|
-
|
100
|
-
it 'works for csv' do
|
101
|
-
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
102
|
-
end
|
103
|
-
|
104
|
-
it 'works for ssv' do
|
105
|
-
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
106
|
-
end
|
107
|
-
|
108
|
-
it 'works for tsv' do
|
109
|
-
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
110
|
-
end
|
111
|
-
|
112
|
-
it 'works for pipes' do
|
113
|
-
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
114
|
-
end
|
115
|
-
|
116
|
-
it 'works for multi' do
|
117
|
-
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
118
|
-
end
|
119
|
-
|
120
|
-
it 'fails for invalid collection format' do
|
121
|
-
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
describe '#json_mime?' do
|
126
|
-
let(:api_client) { PulpGemClient::ApiClient.new }
|
127
|
-
|
128
|
-
it 'works' do
|
129
|
-
expect(api_client.json_mime?(nil)).to eq false
|
130
|
-
expect(api_client.json_mime?('')).to eq false
|
131
|
-
|
132
|
-
expect(api_client.json_mime?('application/json')).to eq true
|
133
|
-
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
134
|
-
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
135
|
-
|
136
|
-
expect(api_client.json_mime?('application/xml')).to eq false
|
137
|
-
expect(api_client.json_mime?('text/plain')).to eq false
|
138
|
-
expect(api_client.json_mime?('application/jsonp')).to eq false
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
describe '#select_header_accept' do
|
143
|
-
let(:api_client) { PulpGemClient::ApiClient.new }
|
144
|
-
|
145
|
-
it 'works' do
|
146
|
-
expect(api_client.select_header_accept(nil)).to be_nil
|
147
|
-
expect(api_client.select_header_accept([])).to be_nil
|
148
|
-
|
149
|
-
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
150
|
-
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
151
|
-
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
152
|
-
|
153
|
-
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
154
|
-
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
describe '#select_header_content_type' do
|
159
|
-
let(:api_client) { PulpGemClient::ApiClient.new }
|
160
|
-
|
161
|
-
it 'works' do
|
162
|
-
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
163
|
-
expect(api_client.select_header_content_type([])).to eq('application/json')
|
164
|
-
|
165
|
-
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
166
|
-
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
167
|
-
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
168
|
-
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
169
|
-
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
170
|
-
end
|
171
|
-
end
|
172
|
-
|
173
|
-
describe '#sanitize_filename' do
|
174
|
-
let(:api_client) { PulpGemClient::ApiClient.new }
|
175
|
-
|
176
|
-
it 'works' do
|
177
|
-
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
178
|
-
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
179
|
-
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
180
|
-
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
181
|
-
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
182
|
-
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
183
|
-
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
184
|
-
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
185
|
-
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
186
|
-
end
|
187
|
-
end
|
188
|
-
end
|
data/spec/configuration_spec.rb
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Pulp 3 API
|
3
|
-
|
4
|
-
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v3
|
7
|
-
Contact: pulp-list@redhat.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
|
15
|
-
describe PulpGemClient::Configuration do
|
16
|
-
let(:config) { PulpGemClient::Configuration.default }
|
17
|
-
|
18
|
-
before(:each) do
|
19
|
-
# uncomment below to setup host and base_path
|
20
|
-
# require 'URI'
|
21
|
-
# uri = URI.parse("http://pulp")
|
22
|
-
# PulpGemClient.configure do |c|
|
23
|
-
# c.host = uri.host
|
24
|
-
# c.base_path = uri.path
|
25
|
-
# end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe '#base_url' do
|
29
|
-
it 'should have the default value' do
|
30
|
-
# uncomment below to test default value of the base path
|
31
|
-
# expect(config.base_url).to eq("http://pulp")
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'should remove trailing slashes' do
|
35
|
-
[nil, '', '/', '//'].each do |base_path|
|
36
|
-
config.base_path = base_path
|
37
|
-
# uncomment below to test trailing slashes
|
38
|
-
# expect(config.base_url).to eq("http://pulp")
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Pulp 3 API
|
3
|
-
|
4
|
-
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v3
|
7
|
-
Contact: pulp-list@redhat.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
require 'date'
|
16
|
-
|
17
|
-
# Unit tests for PulpGemClient::GemGemContent
|
18
|
-
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
-
# Please update as you see appropriate
|
20
|
-
describe 'GemGemContent' do
|
21
|
-
before do
|
22
|
-
# run before each test
|
23
|
-
@instance = PulpGemClient::GemGemContent.new
|
24
|
-
end
|
25
|
-
|
26
|
-
after do
|
27
|
-
# run after each test
|
28
|
-
end
|
29
|
-
|
30
|
-
describe 'test an instance of GemGemContent' do
|
31
|
-
it 'should create an instance of GemGemContent' do
|
32
|
-
expect(@instance).to be_instance_of(PulpGemClient::GemGemContent)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
describe 'test attribute "repository"' do
|
36
|
-
it 'should work' do
|
37
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe 'test attribute "artifact"' do
|
42
|
-
it 'should work' do
|
43
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe 'test attribute "file"' do
|
48
|
-
it 'should work' do
|
49
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|