Skip to content

Commit 49663ba

Browse files
Merge pull request #636 from watson-developer-cloud/mdk/fix-version-date-part3
Change examples and tests to use version to pass version date
2 parents e05e8ee + 45e4569 commit 49663ba

31 files changed

+209
-274
lines changed

examples/browserify/public/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function getToken() {
2828
function analyze(token) {
2929
var toneAnalyzer = new ToneAnalyzerV3({
3030
token: token,
31-
version_date: '2016-05-19'
31+
version: '2016-05-19'
3232
});
3333
toneAnalyzer.tone(
3434
{

examples/conversation.v1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var ConversationV1 = require('watson-developer-cloud/conversation/v1');
88
var conversation = new ConversationV1({
99
username: process.env.CONVERSATION_USERNAME || '<conversation_username>',
1010
password: process.env.CONVERSATION_PASSWORD || '<conversation_password>',
11-
version_date: '2017-05-26'
11+
version: '2017-05-26'
1212
});
1313

1414
/**

examples/conversation_tone_analyzer_integration/tone_conversation_integration.v1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ require('dotenv').config({ silent: true });
4141
var conversation = new ConversationV1({
4242
username: process.env.CONVERSATION_USERNAME || '<conversation_username>',
4343
password: process.env.CONVERSATION_PASSWORD || '<conversation_password>',
44-
version_date: '2017-05-26'
44+
version: '2017-05-26'
4545
});
4646

4747
/**
@@ -50,7 +50,7 @@ var conversation = new ConversationV1({
5050
var toneAnalyzer = new ToneAnalyzerV3({
5151
username: process.env.TONE_ANALYZER_USERNAME || '<tone_analyzer_username>',
5252
password: process.env.TONE_ANALYZER_PASSWORD || '<tone_analyzer_password>',
53-
version_date: '2017-09-21'
53+
version: '2017-09-21'
5454
});
5555

5656
/**

examples/discovery.v1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var discovery = new DiscoveryV1({
1010
// password: 'INSERT YOUR PASSWORD FOR THE SERVICE HERE'
1111
username: 'YOUR USERNAME',
1212
password: 'YOUR PASSWORD',
13-
version_date: '2017_04_27',
13+
version: '2017_04_27',
1414
url: 'https://gateway.watsonplatform.net/discovery/api/'
1515
});
1616

examples/natural_language_understanding.v1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var nlu = new NaturalLanguageUnderstandingV1({
99
// NATURAL_LANGUAGE_UNDERSTANDING_USERNAME & NATURAL_LANGUAGE_UNDERSTANDING_PASSWORD
1010
// username: '<username>'.
1111
// password: '<password>',
12-
version_date: '2017-02-27',
12+
version: '2017-02-27',
1313
url: 'https://gateway.watsonplatform.net/natural-language-understanding/api/'
1414
});
1515

examples/personality_insights.v3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var fs = require('fs');
66
var personalityInsights = new PersonalityInsightsV3({
77
username: 'INSERT YOUR USERNAME FOR THE SERVICE HERE',
88
password: 'INSERT YOUR PASSWORD FOR THE SERVICE HERE',
9-
version_date: '2016-10-19',
9+
version: '2016-10-19',
1010
url: 'https://gateway.watsonplatform.net/personality-insights/api/'
1111
});
1212

examples/tone_analyzer.v3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var ToneAnalyzerV3 = require('watson-developer-cloud/tone-analyzer/v3');
55
var toneAnalyzer = new ToneAnalyzerV3({
66
username: 'INSERT YOUR USERNAME FOR THE SERVICE HERE',
77
password: 'INSERT YOUR PASSWORD FOR THE SERVICE HERE',
8-
version_date: '2017-09-21',
8+
version: '2017-09-21',
99
url: 'https://gateway.watsonplatform.net/tone-analyzer/api/'
1010
});
1111

examples/visual_recognition.v3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var fs = require('fs');
55

66
var visualRecognition = new VisualRecognitionV3({
77
api_key: 'INSERT YOUR API KEY HERE',
8-
version_date: '2016-05-20'
8+
version: '2016-05-20'
99
});
1010

1111
var params = {

examples/webpack/public/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function getToken() {
2828
function analyze(token) {
2929
var toneAnalyzer = new ToneAnalyzerV3({
3030
token: token,
31-
version_date: '2016-05-19'
31+
version: '2016-05-19'
3232
});
3333
toneAnalyzer.tone(
3434
{

test/integration/test.adapter.conversation.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const authHelper = require('./auth_helper.js');
77
const auth = authHelper.auth;
88
const describe = authHelper.describe; // this runs describe.skip if there is no auth.js file :)
99
const assign = require('object.assign'); // for node v0.12 compatibility
10-
const ConversationV1 = require('../../conversation/v1');
1110

1211
const extend = require('extend');
1312

@@ -102,16 +101,19 @@ const test_dialog_node_update = 'updated_node';
102101
// changing language is forbidden starting with VERSION_DATE_2017_05_26
103102
const workspace1 = extend(true, {}, workspace, intents, { language: workspace.language });
104103

105-
describe('conversation_integration', function() {
104+
describe('conversation_adapter_integration', function() {
106105
this.timeout(TEN_SECONDS);
107106
this.slow(TWO_SECONDS); // this controls when the tests get a colored warning for taking too long
108107
// this.retries(1);
109108

110109
let conversation;
111110

112111
before(function() {
113-
auth.conversation.version_date = ConversationV1.VERSION_DATE_2017_05_26;
114-
conversation = watson.conversation(auth.conversation);
112+
const constructorParams = assign({}, auth.conversation, {
113+
version: 'v1',
114+
version_date: '2017-05-26'
115+
});
116+
conversation = watson.conversation(constructorParams);
115117
nock.enableNetConnect();
116118
});
117119

@@ -140,7 +142,8 @@ describe('conversation_integration', function() {
140142

141143
it('dialog_stack with 2017-02-03 version_date', function(done) {
142144
const constructorParams = assign({}, auth.conversation, {
143-
version_date: ConversationV1.VERSION_DATE_2017_02_03
145+
version: 'v1',
146+
version_date: '2017-02-03'
144147
});
145148
const conversation = watson.conversation(constructorParams);
146149

@@ -162,7 +165,8 @@ describe('conversation_integration', function() {
162165

163166
it('dialog_stack with 2016-09-20 version_date', function(done) {
164167
const constructorParams = assign({}, auth.conversation, {
165-
version_date: ConversationV1.VERSION_DATE_2016_09_20
168+
version: 'v1',
169+
version_date: '2016-09-20'
166170
});
167171
const conversation = watson.conversation(constructorParams);
168172

@@ -184,7 +188,8 @@ describe('conversation_integration', function() {
184188

185189
it('dialog_stack with 2016-07-11 version_date', function(done) {
186190
const constructorParams = assign({}, auth.conversation, {
187-
version_date: ConversationV1.VERSION_DATE_2016_07_11
191+
version: 'v1',
192+
version_date: '2016-07-11'
188193
});
189194
const conversation = watson.conversation(constructorParams);
190195

0 commit comments

Comments
 (0)