ibm_cloud_sdk_core 1.1.0 → 1.1.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3aa7649a46616ff68df78f31bb96e4e3f446dbbb860de733539ae0fe33198be2
|
|
4
|
+
data.tar.gz: e277e383682e0e00ab70626e08a02484ebcac0e0fdddb75a4328203308b2dbc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c88b1408600c23b95e93d9b236b2b7f1befefebce6c3af01c406a6d9cf8ee5ed319011ca7ee50ec7be3fd06a9d5e867ab41d3074181fa1a00b0b1f8ad115e12
|
|
7
|
+
data.tar.gz: 102d3450e5019d17efe1217e3d6c21a74dd4883690aba3bc8784995beb5609b61661bf177f6b0a978f92ae5f20560a45bac35996018b61f43c6b6663963819b6
|
|
@@ -26,8 +26,8 @@ module IBMCloudSdkCore
|
|
|
26
26
|
@info = info
|
|
27
27
|
# :nocov:
|
|
28
28
|
end
|
|
29
|
-
@transaction_id = transaction_id
|
|
30
|
-
@global_transaction_id = global_transaction_id
|
|
29
|
+
@transaction_id = transaction_id || response.headers["X-Dp-Watson-Tran-Id"]
|
|
30
|
+
@global_transaction_id = global_transaction_id || response.headers["X-Global-Transaction-Id"]
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def to_s
|
|
@@ -163,15 +163,15 @@ class BaseServiceTest < Minitest::Test
|
|
|
163
163
|
authenticator = IBMCloudSdkCore::BearerTokenAuthenticator.new(bearer_token: "token")
|
|
164
164
|
service = IBMCloudSdkCore::BaseService.new(
|
|
165
165
|
service_name: "assistant",
|
|
166
|
-
authenticator: authenticator
|
|
167
|
-
service_url: "https://gateway.watsonplatform.net/"
|
|
166
|
+
authenticator: authenticator
|
|
168
167
|
)
|
|
168
|
+
service.service_url = "https://gateway.watsonplatform.net/assistant/api/"
|
|
169
169
|
form_data = {}
|
|
170
170
|
file = File.open(Dir.getwd + "/resources/cnc_test.pdf")
|
|
171
171
|
filename = file.path if filename.nil? && file.respond_to?(:path)
|
|
172
172
|
form_data[:file] = HTTP::FormData::File.new(file, content_type: "application/octet-stream", filename: filename)
|
|
173
173
|
|
|
174
|
-
stub_request(:post, "https://gateway.watsonplatform.net/").with do |req|
|
|
174
|
+
stub_request(:post, "https://gateway.watsonplatform.net/assistant/api/dummy/endpoint").with do |req|
|
|
175
175
|
# Test the headers.
|
|
176
176
|
assert_equal(req.headers["Accept"], "application/json")
|
|
177
177
|
assert_match(%r{\Amultipart/form-data}, req.headers["Content-Type"])
|
|
@@ -180,7 +180,7 @@ class BaseServiceTest < Minitest::Test
|
|
|
180
180
|
method: "POST",
|
|
181
181
|
form: form_data,
|
|
182
182
|
headers: { "Accept" => "application/json" },
|
|
183
|
-
url: ""
|
|
183
|
+
url: "dummy/endpoint"
|
|
184
184
|
)
|
|
185
185
|
end
|
|
186
186
|
|
|
@@ -217,7 +217,8 @@ class BaseServiceTest < Minitest::Test
|
|
|
217
217
|
stub_request(:get, "https://we.the.best/music")
|
|
218
218
|
.with(
|
|
219
219
|
headers: {
|
|
220
|
-
"Host" => "we.the.best"
|
|
220
|
+
"Host" => "we.the.best",
|
|
221
|
+
"Authorization" => "Basic YXBpa2V5OmljcC14eXo="
|
|
221
222
|
}
|
|
222
223
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
|
223
224
|
authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
|
|
@@ -226,9 +227,9 @@ class BaseServiceTest < Minitest::Test
|
|
|
226
227
|
)
|
|
227
228
|
service = IBMCloudSdkCore::BaseService.new(
|
|
228
229
|
service_name: "assistant",
|
|
229
|
-
authenticator: authenticator
|
|
230
|
-
service_url: "https://we.the.best"
|
|
230
|
+
authenticator: authenticator
|
|
231
231
|
)
|
|
232
|
+
service.service_url = "https://we.the.best"
|
|
232
233
|
service_response = service.request(method: "GET", url: "/music", headers: {})
|
|
233
234
|
assert_equal(response, service_response.result)
|
|
234
235
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ibm_cloud_sdk_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mamoon Raja
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-01-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: concurrent-ruby
|