mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-11-30 11:45:19 +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.
14 lines
614 B
Python
14 lines
614 B
Python
from remnawave_api.models import GetNodesUsageByRangeResponseDto, GetNodesRealtimeUsageResponseDto
|
|
from tests.utils import generate_isoformat_range
|
|
|
|
|
|
async def test_bandwidthstats(remnawave):
|
|
start, end = generate_isoformat_range()
|
|
nodes_usage_by_range = await remnawave.bandwidthstats.get_nodes_usage_by_range(
|
|
start=start, end=end
|
|
)
|
|
assert isinstance(nodes_usage_by_range, GetNodesUsageByRangeResponseDto)
|
|
|
|
# Test realtime usage
|
|
realtime_usage = await remnawave.bandwidthstats.get_nodes_usage_realtime()
|
|
assert isinstance(realtime_usage, GetNodesRealtimeUsageResponseDto)
|