@@ -112,6 +112,32 @@ def test_invalid_declaration(self):
112112 with pytest .raises (TypeError ):
113113 func ("hello world" )
114114
115+ def test_auto_acknowledge_false_with_acknowledging (self ):
116+ app = App (
117+ client = self .web_client ,
118+ signing_secret = self .signing_secret ,
119+ )
120+ app .function ("reverse" , auto_acknowledge = False )(just_ack )
121+
122+ request = self .build_request_from_body (function_body )
123+ response = app .dispatch (request )
124+ assert response .status == 200
125+ assert_auth_test_count (self , 1 )
126+
127+ def test_auto_acknowledge_false_without_acknowledging (self , caplog ):
128+ app = App (
129+ client = self .web_client ,
130+ signing_secret = self .signing_secret ,
131+ )
132+ app .function ("reverse" , auto_acknowledge = False )(just_no_ack )
133+
134+ request = self .build_request_from_body (function_body )
135+ response = app .dispatch (request )
136+
137+ assert response .status == 404
138+ assert_auth_test_count (self , 1 )
139+ assert f"WARNING { just_no_ack .__name__ } didn't call ack()" in caplog .text
140+
115141
116142function_body = {
117143 "token" : "verification_token" ,
@@ -230,3 +256,14 @@ def complete_it(body, event, complete):
230256 assert body == function_body
231257 assert event == function_body ["event" ]
232258 complete (outputs = {})
259+
260+
261+ def just_ack (ack , body , event ):
262+ assert body == function_body
263+ assert event == function_body ["event" ]
264+ ack ()
265+
266+
267+ def just_no_ack (body , event ):
268+ assert body == function_body
269+ assert event == function_body ["event" ]
0 commit comments