Skip to content

Commit 45e4569

Browse files
author
Mike Kistler
committed
Change version_date to version in tests (except adapter tests).
1 parent 620432f commit 45e4569

21 files changed

+192
-257
lines changed

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

test/integration/test.adapter.personality_insights.v3.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const describe = authHelper.describe; // this runs describe.skip if there is no
1010
const TWENTY_SECONDS = 20000;
1111
const TWO_SECONDS = 2000;
1212

13-
describe('personality_insights_v3_integration', function() {
13+
describe('personality_insights_v3_adapter_integration', function() {
1414
this.retries(1);
1515

1616
this.slow(TWO_SECONDS); // this controls when the tests get a colored warning for taking too long
@@ -20,6 +20,8 @@ describe('personality_insights_v3_integration', function() {
2020

2121
before(function() {
2222
mobydick = fs.readFileSync(path.join(__dirname, '../resources/mobydick.txt'), 'utf8');
23+
auth.personality_insights.v3.version = 'v3';
24+
auth.personality_insights.v3.version_date = '2016-10-19';
2325
personality_insights = watson.personality_insights(auth.personality_insights.v3);
2426
nock.enableNetConnect();
2527
});

test/integration/test.adapter.tone_analyzer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ const describe = authHelper.describe; // this runs describe.skip if there is no
1010
const TWENTY_SECONDS = 20000;
1111
const TWO_SECONDS = 2000;
1212

13-
describe('tone_analyzer_integration', function() {
13+
describe('tone_analyzer_adapter_integration', function() {
1414
this.timeout(TWENTY_SECONDS);
1515
this.slow(TWO_SECONDS); // this controls when the tests get a colored warning for taking too long
1616
this.retries(1);
1717

1818
let tone_analyzer;
1919

2020
before(function() {
21+
auth.tone_analyzer.version = 'v3';
22+
auth.tone_analyzer.version_date = '2016-06-19';
2123
tone_analyzer = watson.tone_analyzer(auth.tone_analyzer);
2224
nock.enableNetConnect();
2325
});

test/integration/test.conversation.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ describe('conversation_integration', function() {
111111
let conversation;
112112

113113
before(function() {
114-
auth.conversation.version_date = '2017-05-26';
115-
conversation = watson.conversation(auth.conversation);
114+
auth.conversation.version = '2017-05-26';
115+
conversation = new watson.ConversationV1(auth.conversation);
116116
nock.enableNetConnect();
117117
});
118118

@@ -139,11 +139,11 @@ describe('conversation_integration', function() {
139139
});
140140
});
141141

142-
it('dialog_stack with 2017-02-03 version_date', function(done) {
142+
it('dialog_stack with 2017-02-03 version', function(done) {
143143
const constructorParams = assign({}, auth.conversation, {
144-
version_date: ConversationV1.VERSION_DATE_2017_02_03
144+
version: ConversationV1.VERSION_DATE_2017_02_03
145145
});
146-
const conversation = watson.conversation(constructorParams);
146+
const conversation = new watson.ConversationV1(constructorParams);
147147

148148
const params = {
149149
input: {
@@ -161,11 +161,11 @@ describe('conversation_integration', function() {
161161
});
162162
});
163163

164-
it('dialog_stack with 2016-09-20 version_date', function(done) {
164+
it('dialog_stack with 2016-09-20 version', function(done) {
165165
const constructorParams = assign({}, auth.conversation, {
166-
version_date: ConversationV1.VERSION_DATE_2016_09_20
166+
version: ConversationV1.VERSION_DATE_2016_09_20
167167
});
168-
const conversation = watson.conversation(constructorParams);
168+
const conversation = new watson.ConversationV1(constructorParams);
169169

170170
const params = {
171171
input: {
@@ -183,11 +183,11 @@ describe('conversation_integration', function() {
183183
});
184184
});
185185

186-
it('dialog_stack with 2016-07-11 version_date', function(done) {
186+
it('dialog_stack with 2016-07-11 version', function(done) {
187187
const constructorParams = assign({}, auth.conversation, {
188-
version_date: ConversationV1.VERSION_DATE_2016_07_11
188+
version: ConversationV1.VERSION_DATE_2016_07_11
189189
});
190-
const conversation = watson.conversation(constructorParams);
190+
const conversation = new watson.ConversationV1(constructorParams);
191191

192192
const params = {
193193
input: {

test/integration/test.dialog.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ describe('dialog_integration', function() {
1919
const client_id = 31;
2020

2121
before(function() {
22+
auth.dialog.version = 'v1';
2223
dialog = watson.dialog(auth.dialog);
2324
dialog_id = auth.dialog.dialog_id;
2425
nock.enableNetConnect();

test/integration/test.discovery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe.skip('discovery_integration', function() {
2626
nock.enableNetConnect();
2727
discovery = new DiscoveryV1(
2828
Object.assign({}, auth.discovery, {
29-
version_date: DiscoveryV1.VERSION_DATE_2017_04_27
29+
version: DiscoveryV1.VERSION_DATE_2017_04_27
3030
})
3131
);
3232
environment_id = auth.discovery.environment_id;

test/integration/test.personality_insights.v2.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe('personality_insights_v2_integration', function() {
2020

2121
before(function() {
2222
mobydick = fs.readFileSync(path.join(__dirname, '../resources/mobydick.txt'), 'utf8');
23+
auth.personality_insights.v2.version = 'v2';
2324
personality_insights = watson.personality_insights(auth.personality_insights.v2);
2425
nock.enableNetConnect();
2526
});

test/integration/test.personality_insights.v3.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ describe('personality_insights_v3_integration', function() {
2020

2121
before(function() {
2222
mobydick = fs.readFileSync(path.join(__dirname, '../resources/mobydick.txt'), 'utf8');
23-
personality_insights = watson.personality_insights(auth.personality_insights.v3);
23+
auth.personality_insights.v3.version = '2016-10-19';
24+
personality_insights = new watson.PersonalityInsightsV3(auth.personality_insights.v3);
2425
nock.enableNetConnect();
2526
});
2627

test/integration/test.text_to_speech.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('text_to_speech_integration', function() {
1717
let text_to_speech;
1818

1919
before(function() {
20-
text_to_speech = watson.text_to_speech(auth.text_to_speech);
20+
text_to_speech = new watson.TextToSpeechV1(auth.text_to_speech);
2121
nock.enableNetConnect();
2222
});
2323

test/integration/test.tone_analyzer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ describe('tone_analyzer_integration', function() {
1919
let tone_analyzer;
2020

2121
before(function() {
22-
tone_analyzer = watson.tone_analyzer(auth.tone_analyzer);
22+
auth.tone_analyzer.version = '2016-06-19';
23+
tone_analyzer = new watson.ToneAnalyzerV3(auth.tone_analyzer);
2324
nock.enableNetConnect();
2425
});
2526

0 commit comments

Comments
 (0)