Skip to content

Commit

Permalink
vision: update system tests after breaking change in #2555
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Nov 3, 2017
1 parent 8c7e8f4 commit 200f93f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/vision/system-test/vision.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ describe('Vision', function() {
it('should detect from a URL', () => {
var url = 'https://upload.wikimedia.org/wikipedia/commons/5/51/Google.png';
return vision.logoDetection({
source: {imageUri: url},
image: {
source: {imageUri: url}
}
}).then(responses => {
var response = responses[0];
assert.deepEqual(response.logoAnnotations[0].description, 'Google');
Expand All @@ -89,7 +91,9 @@ describe('Vision', function() {

it('should detect from a filename', () => {
return vision.logoDetection({
source: {filename: IMAGES.logo},
image: {
source: {filename: IMAGES.logo}
},
}).then(responses => {
var response = responses[0];
assert.deepEqual(response.logoAnnotations[0].description, 'Google');
Expand All @@ -98,7 +102,11 @@ describe('Vision', function() {

it('should detect from a Buffer', () => {
var buffer = fs.readFileSync(IMAGES.logo);
return vision.logoDetection(buffer).then(responses => {
return vision.logoDetection({
image: {
content: buffer
}
}).then(responses => {
var response = responses[0];
assert.deepEqual(response.logoAnnotations[0].description, 'Google');
});
Expand Down

0 comments on commit 200f93f

Please sign in to comment.