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