mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-05-13 20:26:50 +00:00
- Restructured HWID tests into classes for better organization and clarity. - Enhanced subscription tests to cover additional scenarios and improved assertions. - Introduced new tests for system statistics and monitoring. - Implemented CRUD operations for user management with comprehensive test coverage. - Added new controllers and models for handling subscription request history. - Created tests for subscription request history, including pagination and statistics. - Improved error handling in tests to skip when exceptions occur.
29 lines
No EOL
1.3 KiB
Python
29 lines
No EOL
1.3 KiB
Python
import pytest
|
|
|
|
from remnawave.models import (
|
|
GetAllSubscriptionRequestHistoryResponseDto,
|
|
GetSubscriptionRequestHistoryStatsResponseDto
|
|
)
|
|
|
|
|
|
class TestSubscriptionRequestHistory:
|
|
"""Тесты для истории запросов подписок"""
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_get_all_subscription_request_history(self, remnawave):
|
|
"""Тест получения всей истории запросов подписок"""
|
|
response = await remnawave.subscription_request_history.get_all_subscription_request_history(
|
|
size=10,
|
|
start=0
|
|
)
|
|
assert isinstance(response, GetAllSubscriptionRequestHistoryResponseDto)
|
|
assert hasattr(response, 'total')
|
|
assert hasattr(response, 'records')
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_get_subscription_request_history_stats(self, remnawave):
|
|
"""Тест получения статистики истории запросов подписок"""
|
|
response = await remnawave.subscription_request_history.get_subscription_request_history_stats()
|
|
assert isinstance(response, GetSubscriptionRequestHistoryStatsResponseDto)
|
|
assert hasattr(response, 'by_parsed_app')
|
|
assert hasattr(response, 'hourly_request_stats') |