Files
gpu-rent/tests/test_pools.py
T
Leonid Pershin f93ac5a66a Refactor access card printing and update test assertions
- Replaced deprecated console usage in `print_access_card` with a new console import for improved output handling.
- Updated test assertions in `test_pools.py` and `test_prompts.py` for better clarity and accuracy in expected results.
2026-08-21 06:34:45 +03:00

23 lines
828 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 "рекомендация:" in text and "OS_REGION_NAME=ru-6" in text