Skip to content

Commit

Permalink
✅ Fix pagination assertions
Browse files Browse the repository at this point in the history
Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Nov 14, 2024
1 parent 677364a commit 1d7d491
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion acapy_agent/messaging/models/tests/test_base_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ async def test_query(self):
mock_storage.find_all_records.assert_awaited_once_with(
type_filter=BaseRecordImpl.RECORD_TYPE,
tag_query=tag_filter,
order_by=None,
descending=False,
)
assert result and isinstance(result[0], BaseRecordImpl)
assert result[0]._id == record_id
Expand Down Expand Up @@ -216,6 +218,8 @@ async def test_query_post_filter(self):
mock_storage.find_all_records.assert_awaited_once_with(
type_filter=ARecordImpl.RECORD_TYPE,
tag_query=tag_filter,
order_by=None,
descending=False,
)
assert result and isinstance(result[0], ARecordImpl)
assert result[0]._id == record_id
Expand Down Expand Up @@ -339,6 +343,8 @@ async def test_query_with_limit(self):
tag_query=tag_filter,
limit=10,
offset=0,
order_by=None,
descending=False,
)
assert result and isinstance(result[0], ARecordImpl)
assert result[0]._id == record_id
Expand Down Expand Up @@ -369,6 +375,8 @@ async def test_query_with_offset(self):
tag_query=tag_filter,
limit=DEFAULT_PAGE_SIZE,
offset=10,
order_by=None,
descending=False,
)
assert result and isinstance(result[0], ARecordImpl)
assert result[0]._id == record_id
Expand Down Expand Up @@ -399,6 +407,8 @@ async def test_query_with_limit_and_offset(self):
tag_query=tag_filter,
limit=10,
offset=5,
order_by=None,
descending=False,
)
assert result and isinstance(result[0], ARecordImpl)
assert result[0]._id == record_id
Expand Down Expand Up @@ -433,7 +443,10 @@ async def test_query_with_limit_and_offset_and_post_filter(self):
post_filter_positive={"a": "one"},
)
mock_storage.find_all_records.assert_awaited_once_with(
type_filter=ARecordImpl.RECORD_TYPE, tag_query=tag_filter
type_filter=ARecordImpl.RECORD_TYPE,
tag_query=tag_filter,
order_by=None,
descending=False,
)
assert len(result) == 10
assert result and isinstance(result[0], ARecordImpl)
Expand Down

0 comments on commit 1d7d491

Please sign in to comment.