Skip to content

Commit 884fd8e

Browse files
committed
CUST 4499 Added tests, modified CHANGELOG
1 parent 097e36d commit 884fd8e

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ nylas-python Changelog
33

44
Unreleased
55
----------------
6+
* Added support for `earliest_message_date` query parameter for threads
67
* Added support for new message fields query parameter values: `include_tracking_options` and `raw_mime`
78
* Added `tracking_options` field to Message model for message tracking settings
89
* Added `raw_mime` field to Message model for Base64url-encoded message data

tests/resources/test_threads.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,44 @@ def test_list_threads_with_select_param(self, http_client_list_response):
188188

189189
# The actual response validation is handled by the mock in conftest.py
190190
assert result is not None
191+
192+
def test_list_threads_with_earliest_message_date_param(self, http_client_list_response):
193+
threads = Threads(http_client_list_response)
194+
195+
timestamp = 1672531200
196+
197+
http_client_list_response._execute.return_value = {
198+
"request_id": "abc-123",
199+
"data": [{
200+
"id": "thread-123",
201+
"has_attachments": False,
202+
"earliest_message_date": 1672617600,
203+
"participants": [
204+
{"email": "test@example.com", "name": "Test User"}
205+
],
206+
"snippet": "Test snippet",
207+
"unread": False,
208+
"subject": "Test subject",
209+
"message_ids": ["msg-123"],
210+
"folders": ["folder-123"]
211+
}]
212+
}
213+
214+
result = threads.list(
215+
identifier="abc-123",
216+
query_params={"earliest_message_date": timestamp}
217+
)
218+
219+
http_client_list_response._execute.assert_called_with(
220+
"GET",
221+
"/v3/grants/abc-123/threads",
222+
None,
223+
{"earliest_message_date": timestamp},
224+
None,
225+
overrides=None,
226+
)
227+
228+
assert result is not None
191229

192230
def test_find_thread(self, http_client_response):
193231
threads = Threads(http_client_response)

0 commit comments

Comments
 (0)