Skip to content

Commit 6377067

Browse files
committed
refactor(visual-recognition): remove compatibility layer for visual recognition
BREAKING CHANGE: Deprecated methods in Visual Recognition are no longer available. Changed parameter names are no longer interally corrected. To migrate your code, use the methods and parameters currently available with the service as documented here: https://www.ibm.com/watson/developercloud/visual-recognition/api/v3/node.html?node
1 parent 9f10898 commit 6377067

4 files changed

Lines changed: 884 additions & 1077 deletions

File tree

test/integration/test.adapter.tone_analyzer.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

test/unit/test.visual_recognition.v3.js

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('visual_recognition', function() {
181181
});
182182

183183
it('should generate a valid payload with streams', function() {
184-
const params = { image_file: fake_file };
184+
const params = { images_file: fake_file };
185185
const req = visual_recognition.classify(params, noop);
186186
assert.equal(req.uri.href, service.url + classify_path);
187187
assert.equal(req.method, 'POST');
@@ -193,7 +193,7 @@ describe('visual_recognition', function() {
193193
it('should generate a valid paylod with buffers', function() {
194194
const params = {
195195
images_file: fake_buffer,
196-
parameters: { owners: ['me', 'IBM'] },
196+
owners: ['me', 'IBM'],
197197
};
198198
const req = visual_recognition.classify(params, noop);
199199
assert.equal(req.uri.href, service.url + classify_path);
@@ -244,7 +244,7 @@ describe('visual_recognition', function() {
244244
});
245245

246246
it('should generate a valid payload with streams', function() {
247-
const params = { image_file: fake_file };
247+
const params = { images_file: fake_file };
248248
const req = visual_recognition.detectFaces(params, noop);
249249
assert.equal(req.uri.href, service.url + detect_faces_path);
250250
assert.equal(req.method, 'POST');
@@ -343,11 +343,6 @@ describe('visual_recognition', function() {
343343
done();
344344
});
345345
});
346-
describe('retrainClassifier()', function() {
347-
it('should call updateClassifier()', function() {
348-
visual_recognition.retrainClassifier({}, missingParameter);
349-
});
350-
});
351346

352347
describe('updateClassifier()', function() {
353348
it('should check no/insufficient parameters provided', function() {
@@ -529,39 +524,4 @@ describe('visual_recognition', function() {
529524
assert.equal(req.method, 'GET');
530525
});
531526
});
532-
533-
describe('Print a warning for deprecated methods()', function() {
534-
let spy;
535-
beforeEach(function() {
536-
spy = sinon.stub(console, 'warn');
537-
});
538-
afterEach(function() {
539-
spy.restore();
540-
});
541-
after(function() {
542-
spy.restore();
543-
});
544-
545-
const deprecatedMethods = [
546-
'recognizeText',
547-
'createCollection',
548-
'getCollection',
549-
'listCollections',
550-
'deleteCollection',
551-
'addImage',
552-
'listImages',
553-
'getImage',
554-
'deleteImage',
555-
'setImageData',
556-
'getImageData',
557-
'deleteImageData',
558-
'findSimilar',
559-
];
560-
deprecatedMethods.forEach(function(method) {
561-
it(`${method} should print a warning message`, function() {
562-
visual_recognition[method]({}, noop);
563-
assert(spy.calledOnce);
564-
});
565-
});
566-
});
567527
});

0 commit comments

Comments
 (0)