@@ -195,6 +195,36 @@ async def test_failure_multi(self):
195195 assert response .status == 404
196196 await assert_auth_test_count_async (self , 1 )
197197
198+ @pytest .mark .asyncio
199+ async def test_empty_options (self ):
200+ app = AsyncApp (
201+ client = self .web_client ,
202+ signing_secret = self .signing_secret ,
203+ )
204+ app .options ("mes_a" )(show_empty_options )
205+
206+ request = self .build_valid_multi_request ()
207+ response = await app .async_dispatch (request )
208+ assert response .status == 200
209+ assert response .body == """{"options": []}"""
210+ assert response .headers ["content-type" ][0 ] == "application/json;charset=utf-8"
211+ await assert_auth_test_count_async (self , 1 )
212+
213+ @pytest .mark .asyncio
214+ async def test_empty_option_groups (self ):
215+ app = AsyncApp (
216+ client = self .web_client ,
217+ signing_secret = self .signing_secret ,
218+ )
219+ app .options ("mes_a" )(show_empty_option_groups )
220+
221+ request = self .build_valid_multi_request ()
222+ response = await app .async_dispatch (request )
223+ assert response .status == 200
224+ assert response .body == """{"option_groups": []}"""
225+ assert response .headers ["content-type" ][0 ] == "application/json;charset=utf-8"
226+ await assert_auth_test_count_async (self , 1 )
227+
198228
199229body = {
200230 "type" : "block_suggestion" ,
@@ -311,3 +341,15 @@ async def show_multi_options(ack, body, payload, options):
311341 assert body == options
312342 assert payload == options
313343 await ack (multi_response )
344+
345+
346+ async def show_empty_options (ack , body , payload , options ):
347+ assert body == options
348+ assert payload == options
349+ await ack (options = [])
350+
351+
352+ async def show_empty_option_groups (ack , body , payload , options ):
353+ assert body == options
354+ assert payload == options
355+ await ack (option_groups = [])
0 commit comments