Skip to content
This repository has been archived by the owner on Jan 26, 2018. It is now read-only.

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian J. Watson committed Sep 9, 2016
1 parent 1755918 commit 7c1ba99
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
31 changes: 21 additions & 10 deletions test/api_repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ describe('ApiRepo', function() {
});
});
describe('configured for python', function() {
beforeEach(function() {
var testBins = ['protoc', 'grpc_python_plugin'];
fakes = addFakeBinsToPath.apply(null, testBins);
repo = new ApiRepo({
env: {PATH: fakes.path},
languages: ['python'],
templateRoot: path.join(__dirname, '..', 'templates')
});
getsGoodZipFrom(repo.zipUrl);
});
describe('method `buildGaxPackages`', function() {
beforeEach(function() {
var testBins = ['protoc', 'grpc_python_plugin'];
fakes = addFakeBinsToPath.apply(null, testBins);
repo = new ApiRepo({
env: {PATH: fakes.path},
languages: ['python'],
templateRoot: path.join(__dirname, '..', 'templates')
});
getsGoodZipFrom(repo.zipUrl);
});
it('should succeed with unrecognized apis', function(done) {
repo.on('error', function(err) {
expect(err).to.not.be.null();
Expand All @@ -164,6 +164,17 @@ describe('ApiRepo', function() {
});
});
describe('method `buildCommonProtoPkgs`', function() {
beforeEach(function() {
var testBins = ['protoc', 'grpc_python_plugin'];
fakes = addFakeBinsToPath.apply(null, testBins);
repo = new ApiRepo({
buildCommonProtos: true,
env: {PATH: fakes.path},
languages: ['python'],
templateRoot: path.join(__dirname, '..', 'templates')
});
getsGoodZipFrom(repo.zipUrl);
});
it('should pass', function(done) {
repo.on('error', function() {
throw new Error('should not be reached');
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/fake_protoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ main() {
# fix out_dir in case protoc was run for the go plugin
local out_dir=$(echo "$out_dir" | sed 's/.*--go_out=plugins=grpc:\([^ ]*\).*/\1/')
# fix out_dir in case protoc was run for the python plugin
local out_dir=$(echo "$out_dir" | sed 's/.*--grpc_python_out=\([^ ]*\).*/\1/')
local out_dir=$(echo "$out_dir" | sed 's/.*--python_out=\([^ ]*\).*/\1/')
echo "out_dir is $out_dir" 1>&2;
local out_proto_path=${out_dir}/$proto_path
local out_parent=$(dirname $out_proto_path)
Expand Down

0 comments on commit 7c1ba99

Please sign in to comment.