mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-28 04:12:54 +00:00
- Implemented models for nodes usage history including NodeInfoDto, GetUserAccessibleNodesResponse, and usage statistics. - Created subscription-related models such as UserSubscription, SubscriptionInfoData, and various response DTOs for subscription information. - Developed models for subscription settings, templates, and system statistics, enhancing the API's capability to manage and retrieve subscription configurations. - Introduced user management models including CreateUserRequestDto, UpdateUserRequestDto, and various response DTOs for user actions. - Added bulk actions for user updates and statistics tracking, improving the efficiency of user management operations. - Established a base controller for handling API requests and responses, along with decorators for HTTP methods to streamline API interactions. - Included utility functions for serialization using orjson for better performance with Pydantic models.
25 lines
752 B
Python
25 lines
752 B
Python
from datetime import datetime, timedelta
|
|
from typing import List
|
|
|
|
import pytest
|
|
import pytz
|
|
|
|
from remnawave.models import BulkResponseDto, UpdateUserFields
|
|
from tests.conftest import REMNAWAVE_USER_UUID
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_users_bulk_actions(remnawave):
|
|
expire_at = datetime.now(tz=pytz.utc) + timedelta(days=14)
|
|
description = "TEST_DESCRIPTION"
|
|
uuids: List[str] = [REMNAWAVE_USER_UUID]
|
|
|
|
bulk_update_users = await remnawave.users_bulk_actions.bulk_update_users(
|
|
uuids=uuids,
|
|
fields=UpdateUserFields(
|
|
description=description,
|
|
expire_at=expire_at,
|
|
),
|
|
)
|
|
assert isinstance(bulk_update_users, BulkResponseDto)
|
|
assert bulk_update_users.affected_rows == len(uuids)
|