@@ -227,6 +227,53 @@ def test_list_threads_with_earliest_message_date_param(self, http_client_list_re
227227
228228 assert result is not None
229229
230+ def test_list_threads_without_earliest_message_date_in_response (self , http_client_list_response ):
231+ threads = Threads (http_client_list_response )
232+
233+ http_client_list_response ._execute .return_value = {
234+ "request_id" : "abc-123" ,
235+ "data" : [{
236+ "id" : "thread-123" ,
237+ "grant_id" : "test-grant-id" ,
238+ "has_drafts" : False ,
239+ "starred" : False ,
240+ "unread" : False ,
241+ "message_ids" : ["msg-123" ],
242+ "folders" : ["folder-123" ],
243+ "latest_draft_or_message" : {
244+ "body" : "Test message body" ,
245+ "date" : 1672617600 ,
246+ "from" : [{"name" : "Test User" , "email" : "test@example.com" }],
247+ "grant_id" : "test-grant-id" ,
248+ "id" : "msg-123" ,
249+ "object" : "message" ,
250+ "subject" : "Test subject" ,
251+ "thread_id" : "thread-123" ,
252+ "to" : [{"name" : "Recipient" , "email" : "recipient@example.com" }],
253+ "unread" : False ,
254+ },
255+ "has_attachments" : False ,
256+ "participants" : [
257+ {"email" : "test@example.com" , "name" : "Test User" }
258+ ],
259+ "snippet" : "Test snippet" ,
260+ "subject" : "Test subject"
261+ }]
262+ }
263+
264+ result = threads .list (identifier = "abc-123" )
265+
266+ http_client_list_response ._execute .assert_called_with (
267+ "GET" ,
268+ "/v3/grants/abc-123/threads" ,
269+ None ,
270+ None ,
271+ None ,
272+ overrides = None ,
273+ )
274+
275+ assert result is not None
276+
230277 def test_find_thread (self , http_client_response ):
231278 threads = Threads (http_client_response )
232279
0 commit comments