mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-11-30 03:35:08 +00:00
- Updated models and response structures to align with API v2.0.0 specifications. - Enhanced response handling to support both wrapped and unwrapped API responses. - Added new controllers for ConfigProfiles, InternalSquads, InfraBilling, and NodesUsageHistory. - Implemented RootModel patterns for list responses, allowing direct iteration and indexing. - Updated tests to validate new models and endpoints, ensuring 20 out of 21 tests pass with real API integration. - Fixed various bugs related to response handling and model validation. - Documented migration path and breaking changes for users upgrading from v1.x to v2.0.0.
19 lines
734 B
Python
19 lines
734 B
Python
import pytest
|
|
|
|
from remnawave_api.enums import TemplateType
|
|
from remnawave_api.models import GetTemplateResponseDto, UpdateTemplateRequestDto, UpdateTemplateResponseDto
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_subscriptions_template(remnawave):
|
|
template_type: TemplateType = TemplateType.SINGBOX
|
|
template = await remnawave.subscriptions_template.get_template(
|
|
template_type=template_type
|
|
)
|
|
assert isinstance(template, GetTemplateResponseDto)
|
|
|
|
update_template = await remnawave.subscriptions_template.update_template(
|
|
UpdateTemplateRequestDto(template_type=template_type)
|
|
)
|
|
assert isinstance(update_template, UpdateTemplateResponseDto)
|
|
assert update_template.template_type == template_type
|