Skip to content

Commit

Permalink
* Refactored Pub/Sub samples into nice command-line programs, like th…
Browse files Browse the repository at this point in the history
…e new Cloud Storage samples (#164)

* Brought Pub/Sub samples code coverage up to 98.66%
  • Loading branch information
jmdobry authored Aug 10, 2016
1 parent 5f9b9c2 commit f99996d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vision/samples/system-test/faceDetection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('vision:faceDetection', function () {
outputFile,
MockCanvas,
function (err, faces) {
assert(!err);
assert.ifError(err);
assert(faces.length === 1);
var image = fs.readFileSync(outputFile);
assert(image.toString('utf8') === 'testfoobar');
Expand Down
2 changes: 1 addition & 1 deletion vision/samples/system-test/labelDetection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('vision:labelDetection', function () {
labelDetectionSample.main(
inputFile,
function (err, labels) {
assert(!err);
assert.ifError(err);
assert(labels.length > 0);
assert(console.log.calledWith('Found label: cat for ' + inputFile));
done();
Expand Down
2 changes: 1 addition & 1 deletion vision/samples/system-test/landmarkDetection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var inputFile = 'https://cloud-samples-tests.storage.googleapis.com/vision/water
describe('vision:landmarkDetection', function () {
it('should detect landmarks', function (done) {
landmarkDetectionSample.main(inputFile, function (err, landmarks) {
assert(!err);
assert.ifError(err);
assert(landmarks.length > 0);
assert(console.log.calledWith('Found landmark: Taitung, Famous Places "up the water flow" marker for ' + inputFile));
done();
Expand Down
4 changes: 2 additions & 2 deletions vision/samples/system-test/textDetection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ var textDetectionSample = require('../textDetection');
describe('vision:textDetection', function () {
it('should detect texts', function (done) {
textDetectionSample.main(inputDir, function (err, textResponse) {
assert(!err);
assert.ifError(err);
assert(Object.keys(textResponse).length > 0);
textDetectionSample.lookup(['the', 'sunbeams', 'in'], function (err, hits) {
assert(!err);
assert.ifError(err);
assert(hits.length > 0);
assert(hits[0].length > 0);
done();
Expand Down

0 comments on commit f99996d

Please sign in to comment.