Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
fix: regenerate unit tests (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored May 6, 2020
1 parent 7ca140e commit f4a35b3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 74 deletions.
14 changes: 3 additions & 11 deletions 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-iot.git",
"sha": "cc635d6a851a093342f4603574df256ba14643a1"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab",
"internalRef": "307114445"
"remote": "git@github.com:googleapis/nodejs-iot.git",
"sha": "7ca140e19076ba61234478ffcb2d02e4cc6f816b"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d"
"sha": "ab883569eb0257bbf16a6d825fd018b3adde3912"
}
}
],
Expand Down
93 changes: 30 additions & 63 deletions test/gapic_device_manager_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.createDeviceRegistry(request);
}, expectedError);
await assert.rejects(client.createDeviceRegistry(request), expectedError);
assert(
(client.innerApiCalls.createDeviceRegistry as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -413,9 +411,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.getDeviceRegistry(request);
}, expectedError);
await assert.rejects(client.getDeviceRegistry(request), expectedError);
assert(
(client.innerApiCalls.getDeviceRegistry as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -532,9 +528,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.updateDeviceRegistry(request);
}, expectedError);
await assert.rejects(client.updateDeviceRegistry(request), expectedError);
assert(
(client.innerApiCalls.updateDeviceRegistry as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -648,9 +642,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.deleteDeviceRegistry(request);
}, expectedError);
await assert.rejects(client.deleteDeviceRegistry(request), expectedError);
assert(
(client.innerApiCalls.deleteDeviceRegistry as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -762,9 +754,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.createDevice(request);
}, expectedError);
await assert.rejects(client.createDevice(request), expectedError);
assert(
(client.innerApiCalls.createDevice as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -873,9 +863,7 @@ describe('v1.DeviceManagerClient', () => {
};
const expectedError = new Error('expected');
client.innerApiCalls.getDevice = stubSimpleCall(undefined, expectedError);
await assert.rejects(async () => {
await client.getDevice(request);
}, expectedError);
await assert.rejects(client.getDevice(request), expectedError);
assert(
(client.innerApiCalls.getDevice as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -990,9 +978,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.updateDevice(request);
}, expectedError);
await assert.rejects(client.updateDevice(request), expectedError);
assert(
(client.innerApiCalls.updateDevice as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1104,9 +1090,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.deleteDevice(request);
}, expectedError);
await assert.rejects(client.deleteDevice(request), expectedError);
assert(
(client.innerApiCalls.deleteDevice as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1220,9 +1204,10 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.modifyCloudToDeviceConfig(request);
}, expectedError);
await assert.rejects(
client.modifyCloudToDeviceConfig(request),
expectedError
);
assert(
(client.innerApiCalls.modifyCloudToDeviceConfig as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1336,9 +1321,10 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listDeviceConfigVersions(request);
}, expectedError);
await assert.rejects(
client.listDeviceConfigVersions(request),
expectedError
);
assert(
(client.innerApiCalls.listDeviceConfigVersions as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1450,9 +1436,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listDeviceStates(request);
}, expectedError);
await assert.rejects(client.listDeviceStates(request), expectedError);
assert(
(client.innerApiCalls.listDeviceStates as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1564,9 +1548,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.setIamPolicy(request);
}, expectedError);
await assert.rejects(client.setIamPolicy(request), expectedError);
assert(
(client.innerApiCalls.setIamPolicy as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1678,9 +1660,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.getIamPolicy(request);
}, expectedError);
await assert.rejects(client.getIamPolicy(request), expectedError);
assert(
(client.innerApiCalls.getIamPolicy as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1794,9 +1774,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.testIamPermissions(request);
}, expectedError);
await assert.rejects(client.testIamPermissions(request), expectedError);
assert(
(client.innerApiCalls.testIamPermissions as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -1910,9 +1888,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.sendCommandToDevice(request);
}, expectedError);
await assert.rejects(client.sendCommandToDevice(request), expectedError);
assert(
(client.innerApiCalls.sendCommandToDevice as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2026,9 +2002,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.bindDeviceToGateway(request);
}, expectedError);
await assert.rejects(client.bindDeviceToGateway(request), expectedError);
assert(
(client.innerApiCalls.bindDeviceToGateway as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2142,9 +2116,10 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.unbindDeviceFromGateway(request);
}, expectedError);
await assert.rejects(
client.unbindDeviceFromGateway(request),
expectedError
);
assert(
(client.innerApiCalls.unbindDeviceFromGateway as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2262,9 +2237,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listDeviceRegistries(request);
}, expectedError);
await assert.rejects(client.listDeviceRegistries(request), expectedError);
assert(
(client.innerApiCalls.listDeviceRegistries as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2355,9 +2328,7 @@ describe('v1.DeviceManagerClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listDeviceRegistries.createStream as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2556,9 +2527,7 @@ describe('v1.DeviceManagerClient', () => {
undefined,
expectedError
);
await assert.rejects(async () => {
await client.listDevices(request);
}, expectedError);
await assert.rejects(client.listDevices(request), expectedError);
assert(
(client.innerApiCalls.listDevices as SinonStub)
.getCall(0)
Expand Down Expand Up @@ -2642,9 +2611,7 @@ describe('v1.DeviceManagerClient', () => {
reject(err);
});
});
await assert.rejects(async () => {
await promise;
}, expectedError);
await assert.rejects(promise, expectedError);
assert(
(client.descriptors.page.listDevices.createStream as SinonStub)
.getCall(0)
Expand Down

0 comments on commit f4a35b3

Please sign in to comment.