Remnawave_python-sdk/tests/test_users_bulk_actions.py
Artem f47cda9378
feat: Add models for subscriptions, users, and system statistics
- Implemented TemplateResponseDto and UpdateTemplateRequestDto for subscription templates.
- Created models for system statistics including CPU, memory, and bandwidth.
- Developed user models for user creation, updates, and responses.
- Added bulk actions for user updates and statistics tracking.
- Introduced tests for authentication, bandwidth statistics, hosts, inbounds, key generation, nodes, subscriptions, and user management.
- Enhanced utility functions for generating random strings, emails, and date ranges for testing.
2025-04-21 20:44:27 +02:00

25 lines
756 B
Python

from datetime import datetime, timedelta
from typing import List
import pytest
import pytz
from remnawave_api.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)