Remnawave_python-sdk/tests/test_sub_requests.py
Artem 3f0b5af2cf
Refactor tests for HWID, subscriptions, system, and users; add subscription request history functionality
- 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.
2025-10-02 01:46:17 +02:00

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')