@@ -59,6 +59,46 @@ func TestMakeServiceMethods(t *testing.T) {
5959 t .Errorf ("mismatch (-want, +got):\n %s" , diff )
6060 }
6161}
62+ func TestMakeServiceMethodsReturnsEmpty (t * testing.T ) {
63+ model , err := ComputeDisco (t , nil )
64+ if err != nil {
65+ t .Fatal (err )
66+ }
67+ id := "..zoneOperations.delete"
68+ got , ok := model .State .MethodByID [id ]
69+ if ! ok {
70+ t .Fatalf ("expected method %s in the API model" , id )
71+ }
72+ want := & api.Method {
73+ ID : "..zoneOperations.delete" ,
74+ Name : "delete" ,
75+ Documentation : "Deletes the specified zone-specific Operations resource." ,
76+ InputTypeID : "..zoneOperations.deleteRequest" ,
77+ OutputTypeID : ".google.protobuf.Empty" ,
78+ ReturnsEmpty : true ,
79+ PathInfo : & api.PathInfo {
80+ Bindings : []* api.PathBinding {
81+ {
82+ Verb : "DELETE" ,
83+ PathTemplate : api .NewPathTemplate ().
84+ WithLiteral ("compute" ).
85+ WithLiteral ("v1" ).
86+ WithLiteral ("projects" ).
87+ WithVariableNamed ("project" ).
88+ WithLiteral ("zones" ).
89+ WithVariableNamed ("zone" ).
90+ WithLiteral ("operations" ).
91+ WithVariableNamed ("operation" ),
92+ QueryParameters : map [string ]bool {},
93+ },
94+ },
95+ BodyFieldPath : "" ,
96+ },
97+ }
98+ if diff := cmp .Diff (want , got ); diff != "" {
99+ t .Errorf ("mismatch (-want, +got):\n %s" , diff )
100+ }
101+ }
62102
63103func TestMakeServiceMethodsDeprecated (t * testing.T ) {
64104 model , err := ComputeDisco (t , nil )
0 commit comments