Skip to content

Commit

Permalink
fix: regen protos and tests, fix formatting (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored May 6, 2020
1 parent b75950f commit 0bbfdd7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 101 deletions.
14 changes: 3 additions & 11 deletions packages/google-cloud-kms/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@
{
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-kms.git",
"sha": "eb1c2137195137858b344e6d2ebace3005d87fe2"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "756b174de4a122461993c1c583345533d819936d",
"internalRef": "308824110"
"remote": "[email protected]:googleapis/nodejs-kms.git",
"sha": "31837decd96e2e09946d2458be3be0d0f6a35c3b"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "01b6f23d24b27878b48667ce597876d66b59780e"
"sha": "ab883569eb0257bbf16a6d825fd018b3adde3912"
}
}
],
Expand Down
150 changes: 60 additions & 90 deletions packages/google-cloud-kms/test/gapic_key_management_service_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.getKeyRing(request);
}, expectedError);
await assert.rejects(client.getKeyRing(request), expectedError);
assert(
(client.innerApiCalls.getKeyRing as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -435,9 +433,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.getCryptoKey(request);
}, expectedError);
await assert.rejects(client.getCryptoKey(request), expectedError);
assert(
(client.innerApiCalls.getCryptoKey as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -557,9 +553,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.getCryptoKeyVersion(request);
}, expectedError);
await assert.rejects(client.getCryptoKeyVersion(request), expectedError);
assert(
(client.innerApiCalls.getCryptoKeyVersion as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -677,9 +671,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.getPublicKey(request);
}, expectedError);
await assert.rejects(client.getPublicKey(request), expectedError);
assert(
(client.innerApiCalls.getPublicKey as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -797,9 +789,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.getImportJob(request);
}, expectedError);
await assert.rejects(client.getImportJob(request), expectedError);
assert(
(client.innerApiCalls.getImportJob as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -917,9 +907,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.createKeyRing(request);
}, expectedError);
await assert.rejects(client.createKeyRing(request), expectedError);
assert(
(client.innerApiCalls.createKeyRing as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1037,9 +1025,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.createCryptoKey(request);
}, expectedError);
await assert.rejects(client.createCryptoKey(request), expectedError);
assert(
(client.innerApiCalls.createCryptoKey as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1159,9 +1145,10 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.createCryptoKeyVersion(request);
}, expectedError);
await assert.rejects(
client.createCryptoKeyVersion(request),
expectedError
);
assert(
(client.innerApiCalls.createCryptoKeyVersion as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1281,9 +1268,10 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.importCryptoKeyVersion(request);
}, expectedError);
await assert.rejects(
client.importCryptoKeyVersion(request),
expectedError
);
assert(
(client.innerApiCalls.importCryptoKeyVersion as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1401,9 +1389,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.createImportJob(request);
}, expectedError);
await assert.rejects(client.createImportJob(request), expectedError);
assert(
(client.innerApiCalls.createImportJob as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1524,9 +1510,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.updateCryptoKey(request);
}, expectedError);
await assert.rejects(client.updateCryptoKey(request), expectedError);
assert(
(client.innerApiCalls.updateCryptoKey as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1649,9 +1633,10 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.updateCryptoKeyVersion(request);
}, expectedError);
await assert.rejects(
client.updateCryptoKeyVersion(request),
expectedError
);
assert(
(client.innerApiCalls.updateCryptoKeyVersion as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1766,9 +1751,7 @@ describe('v1.KeyManagementServiceClient', () => {
};
const expectedError = new Error('expected');
client.innerApiCalls.encrypt = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.encrypt(request);
}, expectedError);
await assert.rejects(client.encrypt(request), expectedError);
assert(
(client.innerApiCalls.encrypt as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1883,9 +1866,7 @@ describe('v1.KeyManagementServiceClient', () => {
};
const expectedError = new Error('expected');
client.innerApiCalls.decrypt = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.decrypt(request);
}, expectedError);
await assert.rejects(client.decrypt(request), expectedError);
assert(
(client.innerApiCalls.decrypt as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2003,9 +1984,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.asymmetricSign(request);
}, expectedError);
await assert.rejects(client.asymmetricSign(request), expectedError);
assert(
(client.innerApiCalls.asymmetricSign as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2123,9 +2102,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.asymmetricDecrypt(request);
}, expectedError);
await assert.rejects(client.asymmetricDecrypt(request), expectedError);
assert(
(client.innerApiCalls.asymmetricDecrypt as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2245,9 +2222,10 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.updateCryptoKeyPrimaryVersion(request);
}, expectedError);
await assert.rejects(
client.updateCryptoKeyPrimaryVersion(request),
expectedError
);
assert(
(client.innerApiCalls.updateCryptoKeyPrimaryVersion as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2367,9 +2345,10 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.destroyCryptoKeyVersion(request);
}, expectedError);
await assert.rejects(
client.destroyCryptoKeyVersion(request),
expectedError
);
assert(
(client.innerApiCalls.destroyCryptoKeyVersion as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2489,9 +2468,10 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.restoreCryptoKeyVersion(request);
}, expectedError);
await assert.rejects(
client.restoreCryptoKeyVersion(request),
expectedError
);
assert(
(client.innerApiCalls.restoreCryptoKeyVersion as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2613,9 +2593,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listKeyRings(request);
}, expectedError);
await assert.rejects(client.listKeyRings(request), expectedError);
assert(
(client.innerApiCalls.listKeyRings as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2704,9 +2682,7 @@ describe('v1.KeyManagementServiceClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listKeyRings.createStream as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2915,9 +2891,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listCryptoKeys(request);
}, expectedError);
await assert.rejects(client.listCryptoKeys(request), expectedError);
assert(
(client.innerApiCalls.listCryptoKeys as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -3006,9 +2980,7 @@ describe('v1.KeyManagementServiceClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listCryptoKeys.createStream as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -3231,9 +3203,10 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listCryptoKeyVersions(request);
}, expectedError);
await assert.rejects(
client.listCryptoKeyVersions(request),
expectedError
);
assert(
(client.innerApiCalls.listCryptoKeyVersions as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -3335,9 +3308,7 @@ describe('v1.KeyManagementServiceClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listCryptoKeyVersions
.createStream as SinonStub)
Expand Down Expand Up @@ -3553,9 +3524,7 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listImportJobs(request);
}, expectedError);
await assert.rejects(client.listImportJobs(request), expectedError);
assert(
(client.innerApiCalls.listImportJobs as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -3644,9 +3613,7 @@ describe('v1.KeyManagementServiceClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listImportJobs.createStream as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -3842,9 +3809,10 @@ describe('v1.KeyManagementServiceClient', () => {
};
const expectedError = new Error('expected');
client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.getIamPolicy(request, expectedOptions);
}, expectedError);
await assert.rejects(
client.getIamPolicy(request, expectedOptions),
expectedError
);
assert(
(client.iamClient.getIamPolicy as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -3953,9 +3921,10 @@ describe('v1.KeyManagementServiceClient', () => {
};
const expectedError = new Error('expected');
client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.setIamPolicy(request, expectedOptions);
}, expectedError);
await assert.rejects(
client.setIamPolicy(request, expectedOptions),
expectedError
);
assert(
(client.iamClient.setIamPolicy as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -4070,9 +4039,10 @@ describe('v1.KeyManagementServiceClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.testIamPermissions(request, expectedOptions);
}, expectedError);
await assert.rejects(
client.testIamPermissions(request, expectedOptions),
expectedError
);
assert(
(client.iamClient.testIamPermissions as SinonStub)
.getCall(0)
Expand Down

0 comments on commit 0bbfdd7

Please sign in to comment.