Skip to content

Commit a15ed54

Browse files
yoshi-automationJustinBeckwith
authored andcommitted
chore: re-arrange exports. (#121)
1 parent 201c65d commit a15ed54

File tree

3 files changed

+77
-77
lines changed

3 files changed

+77
-77
lines changed

packages/google-cloud-automl/src/v1beta1/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
'use strict';
1616

17-
const PredictionServiceClient = require('./prediction_service_client');
1817
const AutoMlClient = require('./auto_ml_client');
18+
const PredictionServiceClient = require('./prediction_service_client');
1919

20-
module.exports.PredictionServiceClient = PredictionServiceClient;
2120
module.exports.AutoMlClient = AutoMlClient;
21+
module.exports.PredictionServiceClient = PredictionServiceClient;

packages/google-cloud-automl/synth.metadata

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-01-17T12:54:55.387640Z",
2+
"updateTime": "2019-01-30T12:07:46.449548Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.6",
8-
"dockerImage": "googleapis/artman@sha256:12722f2ca3fbc3b53cc6aa5f0e569d7d221b46bd876a2136497089dec5e3634e"
7+
"version": "0.16.7",
8+
"dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "0ac60e21a1aa86c07c1836865b35308ba8178b05",
16-
"internalRef": "229626798"
15+
"sha": "f0195b40fd5f5f412e6819ac01df08cedb8e5fd7",
16+
"internalRef": "231440809"
1717
}
1818
},
1919
{

packages/google-cloud-automl/test/gapic-v1beta1.js

+70-70
Original file line numberDiff line numberDiff line change
@@ -22,76 +22,6 @@ const FAKE_STATUS_CODE = 1;
2222
const error = new Error();
2323
error.code = FAKE_STATUS_CODE;
2424

25-
describe('PredictionServiceClient', () => {
26-
describe('predict', () => {
27-
it('invokes predict without error', done => {
28-
const client = new automlModule.v1beta1.PredictionServiceClient({
29-
credentials: {client_email: 'bogus', private_key: 'bogus'},
30-
projectId: 'bogus',
31-
});
32-
33-
// Mock request
34-
const formattedName = client.modelPath(
35-
'[PROJECT]',
36-
'[LOCATION]',
37-
'[MODEL]'
38-
);
39-
const payload = {};
40-
const request = {
41-
name: formattedName,
42-
payload: payload,
43-
};
44-
45-
// Mock response
46-
const expectedResponse = {};
47-
48-
// Mock Grpc layer
49-
client._innerApiCalls.predict = mockSimpleGrpcMethod(
50-
request,
51-
expectedResponse
52-
);
53-
54-
client.predict(request, (err, response) => {
55-
assert.ifError(err);
56-
assert.deepStrictEqual(response, expectedResponse);
57-
done();
58-
});
59-
});
60-
61-
it('invokes predict with error', done => {
62-
const client = new automlModule.v1beta1.PredictionServiceClient({
63-
credentials: {client_email: 'bogus', private_key: 'bogus'},
64-
projectId: 'bogus',
65-
});
66-
67-
// Mock request
68-
const formattedName = client.modelPath(
69-
'[PROJECT]',
70-
'[LOCATION]',
71-
'[MODEL]'
72-
);
73-
const payload = {};
74-
const request = {
75-
name: formattedName,
76-
payload: payload,
77-
};
78-
79-
// Mock Grpc layer
80-
client._innerApiCalls.predict = mockSimpleGrpcMethod(
81-
request,
82-
null,
83-
error
84-
);
85-
86-
client.predict(request, (err, response) => {
87-
assert(err instanceof Error);
88-
assert.strictEqual(err.code, FAKE_STATUS_CODE);
89-
assert(typeof response === 'undefined');
90-
done();
91-
});
92-
});
93-
});
94-
});
9525
describe('AutoMlClient', () => {
9626
describe('createDataset', () => {
9727
it('invokes createDataset without error', done => {
@@ -1215,6 +1145,76 @@ describe('AutoMlClient', () => {
12151145
});
12161146
});
12171147
});
1148+
describe('PredictionServiceClient', () => {
1149+
describe('predict', () => {
1150+
it('invokes predict without error', done => {
1151+
const client = new automlModule.v1beta1.PredictionServiceClient({
1152+
credentials: {client_email: 'bogus', private_key: 'bogus'},
1153+
projectId: 'bogus',
1154+
});
1155+
1156+
// Mock request
1157+
const formattedName = client.modelPath(
1158+
'[PROJECT]',
1159+
'[LOCATION]',
1160+
'[MODEL]'
1161+
);
1162+
const payload = {};
1163+
const request = {
1164+
name: formattedName,
1165+
payload: payload,
1166+
};
1167+
1168+
// Mock response
1169+
const expectedResponse = {};
1170+
1171+
// Mock Grpc layer
1172+
client._innerApiCalls.predict = mockSimpleGrpcMethod(
1173+
request,
1174+
expectedResponse
1175+
);
1176+
1177+
client.predict(request, (err, response) => {
1178+
assert.ifError(err);
1179+
assert.deepStrictEqual(response, expectedResponse);
1180+
done();
1181+
});
1182+
});
1183+
1184+
it('invokes predict with error', done => {
1185+
const client = new automlModule.v1beta1.PredictionServiceClient({
1186+
credentials: {client_email: 'bogus', private_key: 'bogus'},
1187+
projectId: 'bogus',
1188+
});
1189+
1190+
// Mock request
1191+
const formattedName = client.modelPath(
1192+
'[PROJECT]',
1193+
'[LOCATION]',
1194+
'[MODEL]'
1195+
);
1196+
const payload = {};
1197+
const request = {
1198+
name: formattedName,
1199+
payload: payload,
1200+
};
1201+
1202+
// Mock Grpc layer
1203+
client._innerApiCalls.predict = mockSimpleGrpcMethod(
1204+
request,
1205+
null,
1206+
error
1207+
);
1208+
1209+
client.predict(request, (err, response) => {
1210+
assert(err instanceof Error);
1211+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
1212+
assert(typeof response === 'undefined');
1213+
done();
1214+
});
1215+
});
1216+
});
1217+
});
12181218

12191219
function mockSimpleGrpcMethod(expectedRequest, response, error) {
12201220
return function(actualRequest, options, callback) {

0 commit comments

Comments
 (0)