mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-27 11:51:50 +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.
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import pytest
|
|
|
|
from remnawave.enums import ClientType
|
|
from remnawave.models import GetSubscriptionInfoResponseDto
|
|
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, GetSubscriptionInfoResponseDto)
|
|
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)
|