Remnawave_python-sdk/tests/conftest.py
Artem 950a7ffab3
Add Pydantic models for nodes usage history, subscriptions, and user management
- 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.
2025-07-03 12:22:16 +02:00

46 lines
1.5 KiB
Python

import os
import pytest
from dotenv import load_dotenv
from remnawave import RemnawaveSDK
load_dotenv()
REMNAWAVE_BASE_URL = os.getenv("REMNAWAVE_BASE_URL")
REMNAWAVE_TOKEN = os.getenv("REMNAWAVE_TOKEN")
REMNAWAVE_ADMIN_USERNAME = os.getenv("REMNAWAVE_ADMIN_USERNAME")
REMNAWAVE_ADMIN_PASSWORD = os.getenv("REMNAWAVE_ADMIN_PASSWORD")
REMNAWAVE_INBOUND_UUID = os.getenv("REMNAWAVE_INBOUND_UUID")
REMNAWAVE_CONFIG_PROFILE_UUID = os.getenv("REMNAWAVE_CONFIG_PROFILE_UUID")
REMNAWAVE_USER_UUID = os.getenv("REMNAWAVE_USER_UUID")
REMNAWAVE_SHORT_UUID = os.getenv("REMNAWAVE_SHORT_UUID")
@pytest.fixture
async def remnawave() -> RemnawaveSDK:
assert REMNAWAVE_TOKEN
assert REMNAWAVE_BASE_URL
sdk = RemnawaveSDK(
base_url=REMNAWAVE_BASE_URL,
token=REMNAWAVE_TOKEN,
)
assert sdk.api_tokens_management is not None
assert sdk.auth
assert sdk.bandwidthstats is not None
assert sdk.hosts is not None
assert sdk.hosts_bulk_actions is not None
assert sdk.inbounds is not None
assert sdk.inbounds_bulk_actions is not None
assert sdk.keygen is not None
assert sdk.nodes is not None
assert sdk.subscription is not None
assert sdk.subscriptions_settings is not None
assert sdk.subscriptions_template is not None
assert sdk.system is not None
assert sdk.users is not None
assert sdk.users_bulk_actions is not None
assert sdk.users_stats is not None
assert sdk.xray_config is not None
assert sdk.hwid is not None
return sdk