mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-27 11:51:50 +00:00
- 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.
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import pytest
|
|
|
|
from remnawave_api.enums import ClientType
|
|
from remnawave_api.models import SubscriptionInfoResponseDto
|
|
from tests.conftest import REMNAWAVE_SHORT_UUID
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_subscriptions(remnawave):
|
|
subscription_info = (
|
|
await remnawave.subscription.get_subscription_info_by_short_uuid(
|
|
short_uuid=REMNAWAVE_SHORT_UUID
|
|
)
|
|
)
|
|
assert isinstance(subscription_info, SubscriptionInfoResponseDto)
|
|
assert subscription_info.is_found is True
|
|
|
|
subscription = await remnawave.subscription.get_subscription(
|
|
short_uuid=REMNAWAVE_SHORT_UUID
|
|
)
|
|
assert isinstance(subscription, str)
|
|
|
|
subscription_by_client_type = (
|
|
await remnawave.subscription.get_subscription_by_client_type(
|
|
short_uuid=REMNAWAVE_SHORT_UUID, client_type=ClientType.SINGBOX
|
|
)
|
|
)
|
|
assert isinstance(subscription_by_client_type, str)
|
|
|
|
subscription_with_type = await remnawave.subscription.get_subscription_with_type(
|
|
short_uuid=REMNAWAVE_SHORT_UUID
|
|
)
|
|
assert isinstance(subscription_with_type, str)
|