Files
gpu-rent/tests/test_pools.py
T
Leonid Pershin 28019d1d09 Enhance GPU flavor scanning and update documentation
- Introduced SCAN_POOLS configuration to specify pools for GPU flavor scanning.
- Updated the `flavors` command to scan specified pools and list available GPU flavors based on `FLAVOR_PREFERENCE`.
- Revised CLI documentation to reflect changes in the `flavors` command behavior.
- Enhanced decision documentation to include details about GPU pool scanning.
- Updated setup instructions to guide users on selecting appropriate GPU pools.
2026-08-21 04:03:28 +03:00

23 lines
814 B
Python

from gpu_rent.pools import PoolGpuOffer, format_pool_scan
def test_format_pool_scan_recommends_first_hit():
from gpu_rent.inventory import FlavorInfo
offers = [
PoolGpuOffer(region="ru-7", multizone=False, gpu_labels_found=[], matched=[], gpu_types=[]),
PoolGpuOffer(
region="ru-6",
multizone=True,
gpu_labels_found=["4090-24", "4090-48"],
gpu_types=["4090", "H200"],
matched=[
FlavorInfo("1", "GL-4090", 4, 16384, False, {}, "4090-24"),
],
),
]
text = "\n".join(format_pool_scan(offers, ("4090-24", "4090-48")))
assert "ru-6" in text and "multizone" in text
assert "типы:" in text
assert "рекомендация: OS_REGION_NAME=ru-6" in text