mirror of https://github.com/grpc/grpc-node.git
add test case for partially set options
This commit is contained in:
parent
27d608763b
commit
1e37caadfc
|
@ -139,7 +139,7 @@ describe('Descriptor types', () => {
|
||||||
const service = packageDefinition.Hello as proto_loader.ServiceDefinition
|
const service = packageDefinition.Hello as proto_loader.ServiceDefinition
|
||||||
assert.deepStrictEqual(service.Hello.options, {
|
assert.deepStrictEqual(service.Hello.options, {
|
||||||
deprecated: true,
|
deprecated: true,
|
||||||
idempotency_level: 'IDEMPOTENCY_UNKNOWN',
|
idempotency_level: 'NO_SIDE_EFFECTS',
|
||||||
uninterpreted_option: {
|
uninterpreted_option: {
|
||||||
name: {
|
name: {
|
||||||
name_part: 'foo',
|
name_part: 'foo',
|
||||||
|
@ -165,5 +165,17 @@ describe('Descriptor types', () => {
|
||||||
idempotency_level: 'IDEMPOTENCY_UNKNOWN',
|
idempotency_level: 'IDEMPOTENCY_UNKNOWN',
|
||||||
uninterpreted_option: []
|
uninterpreted_option: []
|
||||||
})
|
})
|
||||||
|
assert.deepStrictEqual(service.HelloWithSomeOptions.options, {
|
||||||
|
deprecated: true,
|
||||||
|
idempotency_level: 'IDEMPOTENCY_UNKNOWN',
|
||||||
|
uninterpreted_option: [],
|
||||||
|
'(google.api.http)': {
|
||||||
|
get: "/hello",
|
||||||
|
additional_bindings: {
|
||||||
|
body: '*',
|
||||||
|
get: '/hello-world'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,7 +13,7 @@ message MethodSignature {
|
||||||
service Hello {
|
service Hello {
|
||||||
rpc Hello (Empty) returns (Empty) {
|
rpc Hello (Empty) returns (Empty) {
|
||||||
option deprecated = true;
|
option deprecated = true;
|
||||||
option idempotency_level = IDEMPOTENCY_UNKNOWN;
|
option idempotency_level = NO_SIDE_EFFECTS;
|
||||||
option uninterpreted_option = {
|
option uninterpreted_option = {
|
||||||
name: {
|
name: {
|
||||||
name_part: 'foo'
|
name_part: 'foo'
|
||||||
|
@ -35,4 +35,14 @@ service Hello {
|
||||||
option (google.api.method_signature) = 'bar';
|
option (google.api.method_signature) = 'bar';
|
||||||
}
|
}
|
||||||
rpc HelloWithoutOptions (Empty) returns (Empty) {}
|
rpc HelloWithoutOptions (Empty) returns (Empty) {}
|
||||||
|
rpc HelloWithSomeOptions (Empty) returns (Empty) {
|
||||||
|
option deprecated = true;
|
||||||
|
option (google.api.http) = {
|
||||||
|
get: "/hello"
|
||||||
|
additional_bindings: {
|
||||||
|
get: "/hello-world"
|
||||||
|
body: "*"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue