Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/integration/test_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from datetime import UTC, datetime
from typing import TYPE_CHECKING, cast

from ._utils import get_random_resource_name, maybe_await
Expand Down Expand Up @@ -67,6 +68,14 @@ async def test_list_actors_sorting(client: ApifyClient | ApifyClientAsync) -> No
assert actors_page.items is not None
assert isinstance(actors_page.items, list)

min_dt = datetime.min.replace(tzinfo=UTC)
sorted_items = sorted(
actors_page.items,
key=lambda a: (a.stats.last_run_started_at if a.stats else None) or min_dt,
reverse=True,
)
assert actors_page.items == sorted_items


async def test_actor_create_update_delete(client: ApifyClient | ApifyClientAsync) -> None:
"""Test creating, updating, and deleting an Actor."""
Expand Down
Loading