Skip to content

Commit

Permalink
Add smoke tests via regeneration (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpebot authored and crwilcox committed Jul 12, 2018
1 parent 1b91ddb commit 7b7598c
Showing 1 changed file with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

describe('ImageAnnotatorSmokeTest', () => {
it('successfully makes a call to the service', done => {
const vision = require('../src');

var client = new vision.v1p2beta1.ImageAnnotatorClient({
// optional auth parameters.
});

var gcsImageUri = 'gs://gapic-toolkit/President_Barack_Obama.jpg';
var source = {
gcsImageUri: gcsImageUri,
};
var image = {
source: source,
};
var type = 'FACE_DETECTION';
var featuresElement = {
type: type,
};
var features = [featuresElement];
var requestsElement = {
image: image,
features: features,
};
var requests = [requestsElement];
client.batchAnnotateImages({requests: requests})
.then(responses => {
var response = responses[0];
console.log(response);
})
.then(done)
.catch(done);
});
});

0 comments on commit 7b7598c

Please sign in to comment.