- Updated terminology from "public-net" to "public-network" for consistency across the codebase. - Enhanced error handling and logging for public network API interactions. - Introduced a new function to determine the public network pool based on the compute region. - Adjusted API request functions to use the new public network terminology and improved error messages. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
653 B
Python
22 lines
653 B
Python
"""public-network API pool mapping and base URL."""
|
|
|
|
from gpu_rent.public_net import public_net_base, public_network_pool
|
|
|
|
|
|
def test_public_network_pool_ru6_maps_to_ru7():
|
|
assert public_network_pool("ru-6") == "ru-7"
|
|
|
|
|
|
def test_public_network_pool_passthrough():
|
|
assert public_network_pool("ru-7") == "ru-7"
|
|
assert public_network_pool("ru-3") == "ru-3"
|
|
|
|
|
|
def test_public_net_base_uses_public_network_path():
|
|
assert public_net_base("ru-7") == (
|
|
"https://ru-7.cloud.api.selcloud.ru/public-network"
|
|
)
|
|
assert public_net_base("ru-6") == (
|
|
"https://ru-7.cloud.api.selcloud.ru/public-network"
|
|
)
|