diff --git a/test/api_repo.js b/test/api_repo.js index c794ce9..a6dd19b 100644 --- a/test/api_repo.js +++ b/test/api_repo.js @@ -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(); @@ -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'); diff --git a/test/fixtures/fake_protoc b/test/fixtures/fake_protoc index b4d4da8..f1c095c 100755 --- a/test/fixtures/fake_protoc +++ b/test/fixtures/fake_protoc @@ -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)