Skip to content

Commit 2f59a47

Browse files
committed
vision: Adding test for imageContext
1 parent 1580d1b commit 2f59a47

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

test/vision/index.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,40 @@ describe('Vision', function() {
311311
async.each(shortNames, checkConfig, done);
312312
});
313313

314+
it('should allow setting imageContext', function(done) {
315+
var imageContext = {
316+
latLongRect: {
317+
minLatLng: {
318+
latitude: 37.420901,
319+
longitude: -122.081293
320+
},
321+
maxLatLng: {
322+
latitude: 37.423228,
323+
longitude: -122.086347
324+
}
325+
}
326+
};
327+
328+
vision.annotate = function(config) {
329+
assert.deepEqual(config, [
330+
{
331+
image: IMAGES[0],
332+
features: {
333+
type: 'LABEL_DETECTION'
334+
},
335+
imageContext: imageContext
336+
}
337+
]);
338+
339+
done();
340+
};
341+
342+
vision.detect(IMAGE, {
343+
types: ['label'],
344+
imageContext: imageContext
345+
}, assert.ifError);
346+
});
347+
314348
it('should allow setting maxResults', function(done) {
315349
var maxResults = 10;
316350

0 commit comments

Comments
 (0)