ibm_watson 1.0.0.rc2 → 1.0.0.rc3
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 +4 -4
- data/README.md +33 -27
- data/lib/ibm_watson/assistant_v1.rb +6 -80
- data/lib/ibm_watson/assistant_v2.rb +6 -38
- data/lib/ibm_watson/compare_comply_v1.rb +6 -47
- data/lib/ibm_watson/discovery_v1.rb +12 -297
- data/lib/ibm_watson/language_translator_v3.rb +6 -41
- data/lib/ibm_watson/natural_language_classifier_v1.rb +6 -35
- data/lib/ibm_watson/natural_language_understanding_v1.rb +6 -38
- data/lib/ibm_watson/personality_insights_v3.rb +6 -30
- data/lib/ibm_watson/speech_to_text_v1.rb +9 -130
- data/lib/ibm_watson/text_to_speech_v1.rb +6 -50
- data/lib/ibm_watson/tone_analyzer_v3.rb +6 -31
- data/lib/ibm_watson/version.rb +1 -1
- data/lib/ibm_watson/visual_recognition_v3.rb +8 -103
- data/lib/ibm_watson/websocket/speech_to_text_websocket_listener.rb +5 -5
- data/lib/ibm_watson.rb +9 -0
- data/test/integration/test_assistant_v1.rb +1 -1
- data/test/integration/test_assistant_v2.rb +1 -1
- data/test/integration/test_compare_comply_v1.rb +1 -1
- data/test/integration/test_discovery_v1.rb +1 -4
- data/test/integration/test_language_translator_v3.rb +1 -1
- data/test/integration/test_natural_language_classifier_v1.rb +1 -1
- data/test/integration/test_natural_language_understanding_v1.rb +1 -1
- data/test/integration/test_personality_insights_v3.rb +1 -1
- data/test/integration/test_speech_to_text_v1.rb +2 -2
- data/test/integration/test_text_to_speech_v1.rb +1 -1
- data/test/integration/test_tone_analyzer_v3.rb +1 -1
- data/test/integration/test_visual_recognition_v3.rb +1 -8
- data/test/unit/test_assistant_v1.rb +45 -45
- data/test/unit/test_assistant_v2.rb +3 -3
- data/test/unit/test_compare_comply_v1.rb +12 -12
- data/test/unit/test_configure_http_client.rb +37 -13
- data/test/unit/test_discovery_v1.rb +47 -139
- data/test/unit/test_language_translator_v3.rb +13 -26
- data/test/unit/test_natural_language_classifier_v1.rb +2 -2
- data/test/unit/test_natural_language_understanding_v1.rb +5 -5
- data/test/unit/test_personality_insights_v3.rb +8 -8
- data/test/unit/test_speech_to_text_v1.rb +21 -21
- data/test/unit/test_text_to_speech_v1.rb +5 -5
- data/test/unit/test_tone_analyzer_v3.rb +9 -9
- data/test/unit/test_vcap_using_personality_insights.rb +8 -8
- data/test/unit/test_visual_recognition_v3.rb +8 -75
- metadata +4 -4
@@ -29,7 +29,7 @@ class AssistantV1Test < Minitest::Test
|
|
29
29
|
"Host" => "gateway.watsonplatform.net"
|
30
30
|
}
|
31
31
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
32
|
-
authenticator =
|
32
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
33
33
|
username: "username",
|
34
34
|
password: "password"
|
35
35
|
)
|
@@ -63,7 +63,7 @@ class AssistantV1Test < Minitest::Test
|
|
63
63
|
"Host" => "gateway.watsonplatform.net"
|
64
64
|
}
|
65
65
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
66
|
-
authenticator =
|
66
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
67
67
|
username: "username",
|
68
68
|
password: "password"
|
69
69
|
)
|
@@ -98,7 +98,7 @@ class AssistantV1Test < Minitest::Test
|
|
98
98
|
"Host" => "gateway.watsonplatform.net"
|
99
99
|
}
|
100
100
|
).to_return(status: 429, body: error_response.to_json, headers: headers)
|
101
|
-
authenticator =
|
101
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
102
102
|
username: "username",
|
103
103
|
password: "password"
|
104
104
|
)
|
@@ -138,7 +138,7 @@ class AssistantV1Test < Minitest::Test
|
|
138
138
|
"Host" => "gateway.watsonplatform.net"
|
139
139
|
}
|
140
140
|
).to_return(status: 407, body: error_response.to_json, headers: headers)
|
141
|
-
authenticator =
|
141
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
142
142
|
username: "username",
|
143
143
|
password: "password"
|
144
144
|
)
|
@@ -169,7 +169,7 @@ class AssistantV1Test < Minitest::Test
|
|
169
169
|
"Host" => "gateway.watsonplatform.net"
|
170
170
|
}
|
171
171
|
).to_return(status: 200, body: {}.to_json, headers: headers)
|
172
|
-
authenticator =
|
172
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
173
173
|
username: "username",
|
174
174
|
password: "password"
|
175
175
|
)
|
@@ -201,7 +201,7 @@ class AssistantV1Test < Minitest::Test
|
|
201
201
|
"Host" => "gateway.watsonplatform.net"
|
202
202
|
}
|
203
203
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
204
|
-
authenticator =
|
204
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
205
205
|
username: "username",
|
206
206
|
password: "password"
|
207
207
|
)
|
@@ -245,7 +245,7 @@ class AssistantV1Test < Minitest::Test
|
|
245
245
|
"Host" => "gateway.watsonplatform.net"
|
246
246
|
}
|
247
247
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
248
|
-
authenticator =
|
248
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
249
249
|
username: "username",
|
250
250
|
password: "password"
|
251
251
|
)
|
@@ -278,7 +278,7 @@ class AssistantV1Test < Minitest::Test
|
|
278
278
|
"Host" => "gateway.watsonplatform.net"
|
279
279
|
}
|
280
280
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
281
|
-
authenticator =
|
281
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
282
282
|
username: "username",
|
283
283
|
password: "password"
|
284
284
|
)
|
@@ -317,7 +317,7 @@ class AssistantV1Test < Minitest::Test
|
|
317
317
|
"Host" => "gateway.watsonplatform.net"
|
318
318
|
}
|
319
319
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
320
|
-
authenticator =
|
320
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
321
321
|
username: "username",
|
322
322
|
password: "password"
|
323
323
|
)
|
@@ -348,7 +348,7 @@ class AssistantV1Test < Minitest::Test
|
|
348
348
|
"Host" => "gateway.watsonplatform.net"
|
349
349
|
}
|
350
350
|
).to_return(status: 200, body: "{}", headers: headers)
|
351
|
-
authenticator =
|
351
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
352
352
|
username: "username",
|
353
353
|
password: "password"
|
354
354
|
)
|
@@ -384,7 +384,7 @@ class AssistantV1Test < Minitest::Test
|
|
384
384
|
"Host" => "gateway.watsonplatform.net"
|
385
385
|
}
|
386
386
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
387
|
-
authenticator =
|
387
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
388
388
|
username: "username",
|
389
389
|
password: "password"
|
390
390
|
)
|
@@ -431,7 +431,7 @@ class AssistantV1Test < Minitest::Test
|
|
431
431
|
"Host" => "gateway.watsonplatform.net"
|
432
432
|
}
|
433
433
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
434
|
-
authenticator =
|
434
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
435
435
|
username: "username",
|
436
436
|
password: "password"
|
437
437
|
)
|
@@ -469,7 +469,7 @@ class AssistantV1Test < Minitest::Test
|
|
469
469
|
"Host" => "gateway.watsonplatform.net"
|
470
470
|
}
|
471
471
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
472
|
-
authenticator =
|
472
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
473
473
|
username: "username",
|
474
474
|
password: "password"
|
475
475
|
)
|
@@ -504,7 +504,7 @@ class AssistantV1Test < Minitest::Test
|
|
504
504
|
"Host" => "gateway.watsonplatform.net"
|
505
505
|
}
|
506
506
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
507
|
-
authenticator =
|
507
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
508
508
|
username: "username",
|
509
509
|
password: "password"
|
510
510
|
)
|
@@ -533,7 +533,7 @@ class AssistantV1Test < Minitest::Test
|
|
533
533
|
"Host" => "gateway.watsonplatform.net"
|
534
534
|
}
|
535
535
|
).to_return(status: 200, body: "{}", headers: headers)
|
536
|
-
authenticator =
|
536
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
537
537
|
username: "username",
|
538
538
|
password: "password"
|
539
539
|
)
|
@@ -566,7 +566,7 @@ class AssistantV1Test < Minitest::Test
|
|
566
566
|
"Host" => "gateway.watsonplatform.net"
|
567
567
|
}
|
568
568
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
569
|
-
authenticator =
|
569
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
570
570
|
username: "username",
|
571
571
|
password: "password"
|
572
572
|
)
|
@@ -611,7 +611,7 @@ class AssistantV1Test < Minitest::Test
|
|
611
611
|
"Host" => "gateway.watsonplatform.net"
|
612
612
|
}
|
613
613
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
614
|
-
authenticator =
|
614
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
615
615
|
username: "username",
|
616
616
|
password: "password"
|
617
617
|
)
|
@@ -645,7 +645,7 @@ class AssistantV1Test < Minitest::Test
|
|
645
645
|
"Host" => "gateway.watsonplatform.net"
|
646
646
|
}
|
647
647
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
648
|
-
authenticator =
|
648
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
649
649
|
username: "username",
|
650
650
|
password: "password"
|
651
651
|
)
|
@@ -683,7 +683,7 @@ class AssistantV1Test < Minitest::Test
|
|
683
683
|
"Host" => "gateway.watsonplatform.net"
|
684
684
|
}
|
685
685
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
686
|
-
authenticator =
|
686
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
687
687
|
username: "username",
|
688
688
|
password: "password"
|
689
689
|
)
|
@@ -711,7 +711,7 @@ class AssistantV1Test < Minitest::Test
|
|
711
711
|
"Host" => "gateway.watsonplatform.net"
|
712
712
|
}
|
713
713
|
).to_return(status: 200, body: "{}", headers: headers)
|
714
|
-
authenticator =
|
714
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
715
715
|
username: "username",
|
716
716
|
password: "password"
|
717
717
|
)
|
@@ -744,7 +744,7 @@ class AssistantV1Test < Minitest::Test
|
|
744
744
|
"Host" => "gateway.watsonplatform.net"
|
745
745
|
}
|
746
746
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
747
|
-
authenticator =
|
747
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
748
748
|
username: "username",
|
749
749
|
password: "password"
|
750
750
|
)
|
@@ -786,7 +786,7 @@ class AssistantV1Test < Minitest::Test
|
|
786
786
|
"Host" => "gateway.watsonplatform.net"
|
787
787
|
}
|
788
788
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
789
|
-
authenticator =
|
789
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
790
790
|
username: "username",
|
791
791
|
password: "password"
|
792
792
|
)
|
@@ -821,7 +821,7 @@ class AssistantV1Test < Minitest::Test
|
|
821
821
|
"Host" => "gateway.watsonplatform.net"
|
822
822
|
}
|
823
823
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
824
|
-
authenticator =
|
824
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
825
825
|
username: "username",
|
826
826
|
password: "password"
|
827
827
|
)
|
@@ -901,7 +901,7 @@ class AssistantV1Test < Minitest::Test
|
|
901
901
|
"Host" => "gateway.watsonplatform.net"
|
902
902
|
}
|
903
903
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
904
|
-
authenticator =
|
904
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
905
905
|
username: "username",
|
906
906
|
password: "password"
|
907
907
|
)
|
@@ -986,7 +986,7 @@ class AssistantV1Test < Minitest::Test
|
|
986
986
|
"Host" => "gateway.watsonplatform.net"
|
987
987
|
}
|
988
988
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
989
|
-
authenticator =
|
989
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
990
990
|
username: "username",
|
991
991
|
password: "password"
|
992
992
|
)
|
@@ -1001,7 +1001,7 @@ class AssistantV1Test < Minitest::Test
|
|
1001
1001
|
end
|
1002
1002
|
|
1003
1003
|
def test_message
|
1004
|
-
authenticator =
|
1004
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1005
1005
|
username: "username",
|
1006
1006
|
password: "password"
|
1007
1007
|
)
|
@@ -1095,7 +1095,7 @@ class AssistantV1Test < Minitest::Test
|
|
1095
1095
|
"Host" => "gateway.watsonplatform.net"
|
1096
1096
|
}
|
1097
1097
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
1098
|
-
authenticator =
|
1098
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1099
1099
|
username: "username",
|
1100
1100
|
password: "password"
|
1101
1101
|
)
|
@@ -1124,7 +1124,7 @@ class AssistantV1Test < Minitest::Test
|
|
1124
1124
|
"Host" => "gateway.watsonplatform.net"
|
1125
1125
|
}
|
1126
1126
|
).to_return(status: 200, body: "", headers: headers)
|
1127
|
-
authenticator =
|
1127
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1128
1128
|
username: "username",
|
1129
1129
|
password: "password"
|
1130
1130
|
)
|
@@ -1158,7 +1158,7 @@ class AssistantV1Test < Minitest::Test
|
|
1158
1158
|
"Host" => "gateway.watsonplatform.net"
|
1159
1159
|
}
|
1160
1160
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1161
|
-
authenticator =
|
1161
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1162
1162
|
username: "username",
|
1163
1163
|
password: "password"
|
1164
1164
|
)
|
@@ -1207,7 +1207,7 @@ class AssistantV1Test < Minitest::Test
|
|
1207
1207
|
"Host" => "gateway.watsonplatform.net"
|
1208
1208
|
}
|
1209
1209
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1210
|
-
authenticator =
|
1210
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1211
1211
|
username: "username",
|
1212
1212
|
password: "password"
|
1213
1213
|
)
|
@@ -1242,7 +1242,7 @@ class AssistantV1Test < Minitest::Test
|
|
1242
1242
|
"Host" => "gateway.watsonplatform.net"
|
1243
1243
|
}
|
1244
1244
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1245
|
-
authenticator =
|
1245
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1246
1246
|
username: "username",
|
1247
1247
|
password: "password"
|
1248
1248
|
)
|
@@ -1281,7 +1281,7 @@ class AssistantV1Test < Minitest::Test
|
|
1281
1281
|
"Host" => "gateway.watsonplatform.net"
|
1282
1282
|
}
|
1283
1283
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
1284
|
-
authenticator =
|
1284
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1285
1285
|
username: "username",
|
1286
1286
|
password: "password"
|
1287
1287
|
)
|
@@ -1309,7 +1309,7 @@ class AssistantV1Test < Minitest::Test
|
|
1309
1309
|
"Host" => "gateway.watsonplatform.net"
|
1310
1310
|
}
|
1311
1311
|
).to_return(status: 200, body: "", headers: headers)
|
1312
|
-
authenticator =
|
1312
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1313
1313
|
username: "username",
|
1314
1314
|
password: "password"
|
1315
1315
|
)
|
@@ -1346,7 +1346,7 @@ class AssistantV1Test < Minitest::Test
|
|
1346
1346
|
"Host" => "gateway.watsonplatform.net"
|
1347
1347
|
}
|
1348
1348
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1349
|
-
authenticator =
|
1349
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1350
1350
|
username: "username",
|
1351
1351
|
password: "password"
|
1352
1352
|
)
|
@@ -1394,7 +1394,7 @@ class AssistantV1Test < Minitest::Test
|
|
1394
1394
|
"Host" => "gateway.watsonplatform.net"
|
1395
1395
|
}
|
1396
1396
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1397
|
-
authenticator =
|
1397
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1398
1398
|
username: "username",
|
1399
1399
|
password: "password"
|
1400
1400
|
)
|
@@ -1433,7 +1433,7 @@ class AssistantV1Test < Minitest::Test
|
|
1433
1433
|
"Host" => "gateway.watsonplatform.net"
|
1434
1434
|
}
|
1435
1435
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1436
|
-
authenticator =
|
1436
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1437
1437
|
username: "username",
|
1438
1438
|
password: "password"
|
1439
1439
|
)
|
@@ -1475,7 +1475,7 @@ class AssistantV1Test < Minitest::Test
|
|
1475
1475
|
"Host" => "gateway.watsonplatform.net"
|
1476
1476
|
}
|
1477
1477
|
).to_return(status: 201, body: response.to_json, headers: headers)
|
1478
|
-
authenticator =
|
1478
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1479
1479
|
username: "username",
|
1480
1480
|
password: "password"
|
1481
1481
|
)
|
@@ -1505,7 +1505,7 @@ class AssistantV1Test < Minitest::Test
|
|
1505
1505
|
"Host" => "gateway.watsonplatform.net"
|
1506
1506
|
}
|
1507
1507
|
).to_return(status: 200, body: "", headers: headers)
|
1508
|
-
authenticator =
|
1508
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1509
1509
|
username: "username",
|
1510
1510
|
password: "password"
|
1511
1511
|
)
|
@@ -1542,7 +1542,7 @@ class AssistantV1Test < Minitest::Test
|
|
1542
1542
|
"Host" => "gateway.watsonplatform.net"
|
1543
1543
|
}
|
1544
1544
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1545
|
-
authenticator =
|
1545
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1546
1546
|
username: "username",
|
1547
1547
|
password: "password"
|
1548
1548
|
)
|
@@ -1586,7 +1586,7 @@ class AssistantV1Test < Minitest::Test
|
|
1586
1586
|
"Host" => "gateway.watsonplatform.net"
|
1587
1587
|
}
|
1588
1588
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1589
|
-
authenticator =
|
1589
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1590
1590
|
username: "username",
|
1591
1591
|
password: "password"
|
1592
1592
|
)
|
@@ -1621,7 +1621,7 @@ class AssistantV1Test < Minitest::Test
|
|
1621
1621
|
"Host" => "gateway.watsonplatform.net"
|
1622
1622
|
}
|
1623
1623
|
).to_return(status: 200, body: response.to_json, headers: headers)
|
1624
|
-
authenticator =
|
1624
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1625
1625
|
username: "username",
|
1626
1626
|
password: "password"
|
1627
1627
|
)
|
@@ -1641,7 +1641,7 @@ class AssistantV1Test < Minitest::Test
|
|
1641
1641
|
end
|
1642
1642
|
|
1643
1643
|
def test_dialog_nodes
|
1644
|
-
authenticator =
|
1644
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1645
1645
|
username: "username",
|
1646
1646
|
password: "password"
|
1647
1647
|
)
|
@@ -1724,7 +1724,7 @@ class AssistantV1Test < Minitest::Test
|
|
1724
1724
|
"Host" => "gateway.watsonplatform.net"
|
1725
1725
|
}
|
1726
1726
|
).to_return(status: 200, body: "", headers: headers)
|
1727
|
-
authenticator =
|
1727
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1728
1728
|
username: "username",
|
1729
1729
|
password: "password"
|
1730
1730
|
)
|
@@ -1739,7 +1739,7 @@ class AssistantV1Test < Minitest::Test
|
|
1739
1739
|
end
|
1740
1740
|
|
1741
1741
|
def test_update_dialog_node
|
1742
|
-
authenticator =
|
1742
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1743
1743
|
username: "username",
|
1744
1744
|
password: "password"
|
1745
1745
|
)
|
@@ -1767,7 +1767,7 @@ class AssistantV1Test < Minitest::Test
|
|
1767
1767
|
end
|
1768
1768
|
|
1769
1769
|
def test_list_mentions
|
1770
|
-
authenticator =
|
1770
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
1771
1771
|
username: "username",
|
1772
1772
|
password: "password"
|
1773
1773
|
)
|
@@ -10,7 +10,7 @@ WebMock.disable_net_connect!(allow_localhost: true)
|
|
10
10
|
# Unit tests for the Watson Assistant V1 Service
|
11
11
|
class AssistantV2Test < Minitest::Test
|
12
12
|
def test_message
|
13
|
-
authenticator =
|
13
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
14
14
|
username: "username",
|
15
15
|
password: "password"
|
16
16
|
)
|
@@ -109,7 +109,7 @@ class AssistantV2Test < Minitest::Test
|
|
109
109
|
"Host" => "gateway.watsonplatform.net"
|
110
110
|
}
|
111
111
|
).to_return(status: 200, body: "", headers: {})
|
112
|
-
authenticator =
|
112
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
113
113
|
username: "username",
|
114
114
|
password: "password"
|
115
115
|
)
|
@@ -132,7 +132,7 @@ class AssistantV2Test < Minitest::Test
|
|
132
132
|
"Host" => "gateway.watsonplatform.net"
|
133
133
|
}
|
134
134
|
).to_return(status: 200, body: "", headers: {})
|
135
|
-
authenticator =
|
135
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
136
136
|
username: "username",
|
137
137
|
password: "password"
|
138
138
|
)
|
@@ -11,7 +11,7 @@ WebMock.disable_net_connect!(allow_localhost: true)
|
|
11
11
|
class CompareComplyV1 < Minitest::Test
|
12
12
|
def test_convert_to_html
|
13
13
|
# service.set_default_headers("x-watson-learning-opt-out" => true)
|
14
|
-
authenticator =
|
14
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
15
15
|
bearer_token: "token"
|
16
16
|
)
|
17
17
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -31,7 +31,7 @@ class CompareComplyV1 < Minitest::Test
|
|
31
31
|
|
32
32
|
def test_classify_elements
|
33
33
|
# service.set_default_headers("x-watson-learning-opt-out" => true)
|
34
|
-
authenticator =
|
34
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
35
35
|
bearer_token: "token"
|
36
36
|
)
|
37
37
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -54,7 +54,7 @@ class CompareComplyV1 < Minitest::Test
|
|
54
54
|
|
55
55
|
def test_extract_tables
|
56
56
|
# service.set_default_headers("x-watson-learning-opt-out" => true)
|
57
|
-
authenticator =
|
57
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
58
58
|
bearer_token: "token"
|
59
59
|
)
|
60
60
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -77,7 +77,7 @@ class CompareComplyV1 < Minitest::Test
|
|
77
77
|
|
78
78
|
def test_compare_documents
|
79
79
|
# service.set_default_headers("x-watson-learning-opt-out" => true)
|
80
|
-
authenticator =
|
80
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
81
81
|
bearer_token: "token"
|
82
82
|
)
|
83
83
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -101,7 +101,7 @@ class CompareComplyV1 < Minitest::Test
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def test_list_feedback
|
104
|
-
authenticator =
|
104
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
105
105
|
bearer_token: "token"
|
106
106
|
)
|
107
107
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -133,7 +133,7 @@ class CompareComplyV1 < Minitest::Test
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def test_add_feedback
|
136
|
-
authenticator =
|
136
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
137
137
|
bearer_token: "token"
|
138
138
|
)
|
139
139
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -162,7 +162,7 @@ class CompareComplyV1 < Minitest::Test
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def test_get_feedback
|
165
|
-
authenticator =
|
165
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
166
166
|
bearer_token: "token"
|
167
167
|
)
|
168
168
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -191,7 +191,7 @@ class CompareComplyV1 < Minitest::Test
|
|
191
191
|
end
|
192
192
|
|
193
193
|
def test_delete_feedback
|
194
|
-
authenticator =
|
194
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
195
195
|
bearer_token: "token"
|
196
196
|
)
|
197
197
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -215,7 +215,7 @@ class CompareComplyV1 < Minitest::Test
|
|
215
215
|
end
|
216
216
|
|
217
217
|
def test_create_batch
|
218
|
-
authenticator =
|
218
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
219
219
|
bearer_token: "token"
|
220
220
|
)
|
221
221
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -240,7 +240,7 @@ class CompareComplyV1 < Minitest::Test
|
|
240
240
|
end
|
241
241
|
|
242
242
|
def test_list_batches
|
243
|
-
authenticator =
|
243
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
244
244
|
bearer_token: "token"
|
245
245
|
)
|
246
246
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -267,7 +267,7 @@ class CompareComplyV1 < Minitest::Test
|
|
267
267
|
end
|
268
268
|
|
269
269
|
def test_get_batch
|
270
|
-
authenticator =
|
270
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
271
271
|
bearer_token: "token"
|
272
272
|
)
|
273
273
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -291,7 +291,7 @@ class CompareComplyV1 < Minitest::Test
|
|
291
291
|
end
|
292
292
|
|
293
293
|
def test_update_batch
|
294
|
-
authenticator =
|
294
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
295
295
|
bearer_token: "token"
|
296
296
|
)
|
297
297
|
service = IBMWatson::CompareComplyV1.new(
|
@@ -9,7 +9,7 @@ WebMock.disable_net_connect!(allow_localhost: true)
|
|
9
9
|
# Unit tests for the configure_http_client customizations, such as proxies and timeouts
|
10
10
|
class HTTPConfigTest < Minitest::Test
|
11
11
|
def test_proxy_address_port
|
12
|
-
authenticator =
|
12
|
+
authenticator = IBMWatson::Authenticators::BearerTokenAuthenticator.new(
|
13
13
|
bearer_token: "token"
|
14
14
|
)
|
15
15
|
service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
@@ -28,11 +28,15 @@ class HTTPConfigTest < Minitest::Test
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_proxy_username_password
|
31
|
-
|
32
|
-
version: "2018-03-16",
|
31
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
33
32
|
username: "username",
|
34
33
|
password: "password"
|
35
34
|
)
|
35
|
+
|
36
|
+
service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
37
|
+
version: "2018-03-16",
|
38
|
+
authenticator: authenticator
|
39
|
+
)
|
36
40
|
service.configure_http_client(
|
37
41
|
proxy: {
|
38
42
|
address: "bogus_address.com",
|
@@ -49,11 +53,15 @@ class HTTPConfigTest < Minitest::Test
|
|
49
53
|
end
|
50
54
|
|
51
55
|
def test_proxy_headers
|
52
|
-
|
53
|
-
version: "2018-03-16",
|
56
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
54
57
|
username: "username",
|
55
58
|
password: "password"
|
56
59
|
)
|
60
|
+
|
61
|
+
service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
62
|
+
version: "2018-03-16",
|
63
|
+
authenticator: authenticator
|
64
|
+
)
|
57
65
|
service.configure_http_client(
|
58
66
|
proxy: {
|
59
67
|
address: "bogus_address.com",
|
@@ -70,11 +78,15 @@ class HTTPConfigTest < Minitest::Test
|
|
70
78
|
end
|
71
79
|
|
72
80
|
def test_proxy_username_password_headers
|
73
|
-
|
74
|
-
version: "2018-03-16",
|
81
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
75
82
|
username: "username",
|
76
83
|
password: "password"
|
77
84
|
)
|
85
|
+
|
86
|
+
service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
87
|
+
version: "2018-03-16",
|
88
|
+
authenticator: authenticator
|
89
|
+
)
|
78
90
|
service.configure_http_client(
|
79
91
|
proxy: {
|
80
92
|
address: "bogus_address.com",
|
@@ -95,11 +107,15 @@ class HTTPConfigTest < Minitest::Test
|
|
95
107
|
end
|
96
108
|
|
97
109
|
def test_timeout_per_operation
|
98
|
-
|
99
|
-
version: "2018-03-16",
|
110
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
100
111
|
username: "username",
|
101
112
|
password: "password"
|
102
113
|
)
|
114
|
+
|
115
|
+
service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
116
|
+
version: "2018-03-16",
|
117
|
+
authenticator: authenticator
|
118
|
+
)
|
103
119
|
service.configure_http_client(
|
104
120
|
timeout: {
|
105
121
|
per_operation: {
|
@@ -122,11 +138,15 @@ class HTTPConfigTest < Minitest::Test
|
|
122
138
|
end
|
123
139
|
|
124
140
|
def test_timeout_global
|
125
|
-
|
126
|
-
version: "2018-03-16",
|
141
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
127
142
|
username: "username",
|
128
143
|
password: "password"
|
129
144
|
)
|
145
|
+
|
146
|
+
service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
147
|
+
version: "2018-03-16",
|
148
|
+
authenticator: authenticator
|
149
|
+
)
|
130
150
|
service.configure_http_client(
|
131
151
|
timeout: {
|
132
152
|
global: 20
|
@@ -143,11 +163,15 @@ class HTTPConfigTest < Minitest::Test
|
|
143
163
|
end
|
144
164
|
|
145
165
|
def test_disable_ssl_verification
|
146
|
-
|
147
|
-
version: "2018-03-16",
|
166
|
+
authenticator = IBMWatson::Authenticators::BasicAuthenticator.new(
|
148
167
|
username: "username",
|
149
168
|
password: "password"
|
150
169
|
)
|
170
|
+
|
171
|
+
service = IBMWatson::NaturalLanguageUnderstandingV1.new(
|
172
|
+
version: "2018-03-16",
|
173
|
+
authenticator: authenticator
|
174
|
+
)
|
151
175
|
service.configure_http_client(disable_ssl_verification: true)
|
152
176
|
refute_nil(service.conn.default_options.ssl_context)
|
153
177
|
end
|