From 1dae3c3ef962bafe628da0635450d2cf43493af7 Mon Sep 17 00:00:00 2001 From: kanat Date: Wed, 21 Feb 2024 09:05:35 -0800 Subject: [PATCH] [PBE-1321] use SortOrder --- stream_chat/tests/async_chat/test_segment.py | 5 +++-- stream_chat/tests/test_segment.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/stream_chat/tests/async_chat/test_segment.py b/stream_chat/tests/async_chat/test_segment.py index 4c2ec98..f985e2b 100644 --- a/stream_chat/tests/async_chat/test_segment.py +++ b/stream_chat/tests/async_chat/test_segment.py @@ -3,6 +3,7 @@ import pytest from stream_chat.async_chat.client import StreamChatAsync +from stream_chat.types.base import SortOrder from stream_chat.types.segment import SegmentType @@ -70,12 +71,12 @@ async def test_segment_targets(self, client: StreamChatAsync): assert "next" in query_targets_1 assert len(query_targets_1["targets"]) == 3 - query_targets_2 = segment.query_targets( + query_targets_2 = await segment.query_targets( filter_conditions={"target_id": {"$lte": ""}}, options={ "limit": 3, "next": query_targets_1["next"], - "sort": [{"field": "target_id", "direction": -1}], + "sort": [{"field": "target_id", "direction": SortOrder.DESC}], }, ) assert query_targets_2.is_ok() diff --git a/stream_chat/tests/test_segment.py b/stream_chat/tests/test_segment.py index ae526fa..a2a9749 100644 --- a/stream_chat/tests/test_segment.py +++ b/stream_chat/tests/test_segment.py @@ -3,6 +3,7 @@ import pytest from stream_chat import StreamChat +from stream_chat.types.base import SortOrder from stream_chat.types.segment import SegmentType @@ -75,7 +76,7 @@ def test_segment_targets(self, client: StreamChat): options={ "limit": 3, "next": query_targets_1["next"], - "sort": [{"field": "target_id", "direction": -1}], + "sort": [{"field": "target_id", "direction": SortOrder.DESC}], }, ) assert query_targets_2.is_ok()