mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-05-13 12:16:42 +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.
47 lines
1.5 KiB
Python
47 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")
|
|
REMNAWAVE_USER_USERNAME = os.getenv("REMNAWAVE_USER_USERNAME")
|
|
|
|
@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
|