@@ -144,6 +144,9 @@ async def test_mock_generic_should_support_implicit_output(self):
144
144
# implicitly
145
145
self .assertEqual (r .response .result .status ,
146
146
protos .StatusResult .Success )
147
+ self .assertEqual (
148
+ r .response .return_value ,
149
+ protos .TypedData (bytes = b'\x00 \x01 ' ))
147
150
148
151
async def test_mock_generic_should_support_without_datatype (self ):
149
152
async with testutils .start_mockhost (
@@ -195,3 +198,28 @@ async def test_mock_generic_implicit_output_exemption(self):
195
198
# For the Durable Functions durableClient case
196
199
self .assertEqual (r .response .result .status ,
197
200
protos .StatusResult .Failure )
201
+
202
+ async def test_mock_generic_as_nil_data (self ):
203
+ async with testutils .start_mockhost (
204
+ script_root = self .generic_funcs_dir ) as host :
205
+
206
+ await host .init_worker ("4.17.1" )
207
+ func_id , r = await host .load_function ('foobar_nil_data' )
208
+
209
+ self .assertEqual (r .response .function_id , func_id )
210
+ self .assertEqual (r .response .result .status ,
211
+ protos .StatusResult .Success )
212
+
213
+ _ , r = await host .invoke_function (
214
+ 'foobar_nil_data' , [
215
+ protos .ParameterBinding (
216
+ name = 'input' ,
217
+ data = protos .TypedData ()
218
+ )
219
+ ]
220
+ )
221
+ self .assertEqual (r .response .result .status ,
222
+ protos .StatusResult .Success )
223
+ self .assertEqual (
224
+ r .response .return_value ,
225
+ protos .TypedData ())
0 commit comments