Files
airdef/tools/test_airdef_build.py
T
chexit 88757d05f8 Auto-install the DLSS toolchain on Windows + NVIDIA RTX
`airdef.py game` no longer needs manual SDK setup. On Windows with an RTX
adapter, when neither DLSS_SDK nor VULKAN_SDK is set, it downloads only the
files dlss_wgpu reads:

- NVIDIA/DLSS at the newest stable v310.9.x tag (GitHub API; pinned v310.9.1
  when the API fails): include/*.h, both x64 static libs and the runtime
  rel/nvngx_dlss.dll (~67 MB once), laid out under
  .horizon-cache/dlss-sdk/<tag>/ exactly as valid_dlss_sdk expects.
- KhronosGroup/Vulkan-Headers include/ under
  .horizon-cache/vulkan-headers/<tag>/Include/, since build.rs uses headers
  only and links no Vulkan library.

The resolved roots are passed to cargo as DLSS_SDK/VULKAN_SDK, and after a
successful dlss build the fresh nvngx_dlss.dll is copied beside the built
horizon-client.exe. Explicit DLSS_SDK/VULKAN_SDK (and the sdk argument)
keep priority and disable auto-download for that component. Any network or
layout failure warns and falls back to --features mods/native TAAU instead
of failing the build; non-Windows and non-RTX take the old mods path with
no network access.

valid_dlss_sdk now looks for the real nvsdk_ngx*.h names instead of the
nonexistent nvngx*.h glob, so a genuine SDK (and the downloaded cache) is
recognised at all.

Tests cover tag selection and fallback, selective layout + marker cache
hit, damaged/partial caches, streamed download and truncation, Vulkan
Include layout, plan env wiring, explicit-env precedence, failure to mods,
and DLL placement beside the client.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 15:39:56 +03:00

472 lines
23 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Real Git migration regression; no network, user settings or player data."""
import contextlib
import importlib.util
import io
import json
import os
from pathlib import Path
import subprocess
import tempfile
import unittest
from unittest.mock import patch
SPEC = importlib.util.spec_from_file_location("airdef_build", Path(__file__).with_name("airdef.py"))
airdef = importlib.util.module_from_spec(SPEC)
SPEC.loader.exec_module(airdef)
def git(at, *args):
return subprocess.check_output(["git", "-C", str(at), *args], text=True, stderr=subprocess.STDOUT).strip()
def init(at):
at.mkdir()
git(at, "init", "-q")
git(at, "config", "user.name", "Test")
git(at, "config", "user.email", "test@example.invalid")
def commit(at, text):
(at / "engine.txt").write_text(text)
git(at, "add", "engine.txt")
git(at, "commit", "-qm", text)
return git(at, "rev-parse", "HEAD")
class ForkMigrationTests(unittest.TestCase):
def test_stale_local_url_is_synced_before_fetching_new_pin(self):
with tempfile.TemporaryDirectory(prefix="airdef-fork-test-") as tmp, patch.dict(os.environ, {"GIT_ALLOW_PROTOCOL": "file"}):
root = Path(tmp)
source, parent = root / "source", root / "airdef"
init(source)
old = commit(source, "old")
canonical = root / "canonical.git"
git(root, "clone", "--bare", str(source), str(canonical))
init(parent)
git(parent, "submodule", "add", str(canonical), "horizon")
child = parent / "horizon"
new = commit(source, "new-fork-only-pin")
git(source, "push", str(canonical), "HEAD")
git(parent, "update-index", "--cacheinfo", f"160000,{new},horizon")
stale = str(root / "missing-upstream.git")
git(parent, "config", "submodule.horizon.url", stale)
git(child, "remote", "set-url", "origin", stale)
self.assertEqual(git(child, "rev-parse", "HEAD"), old)
with patch.object(airdef, "ROOT", parent), patch.object(airdef, "FORK", child):
airdef.fork()
self.assertEqual(git(child, "rev-parse", "HEAD"), new)
self.assertEqual(git(child, "remote", "get-url", "origin"), str(canonical))
# The fast path must also repair stale configuration for the next update.
git(child, "remote", "set-url", "origin", stale)
airdef.fork()
self.assertEqual(git(child, "remote", "get-url", "origin"), str(canonical))
class DlssBuildFeatureTests(unittest.TestCase):
"""Feature-строку решает детект Windows + RTX + SDK; на Mac и при сбоях — просто mods."""
def setUp(self):
self.tmp = tempfile.TemporaryDirectory(prefix="airdef-dlss-test-")
self.root = Path(self.tmp.name)
self.sdk = self.root / "DLSS"
(self.sdk / "include").mkdir(parents=True)
(self.sdk / "include" / "nvsdk_ngx.h").write_text("")
(self.sdk / "lib" / "Windows_x86_64" / "x64").mkdir(parents=True)
self.vulkan = self.root / "VulkanSDK"
(self.vulkan / "Include" / "vulkan").mkdir(parents=True)
(self.vulkan / "Include" / "vulkan" / "vulkan.h").write_text("")
def tearDown(self):
self.tmp.cleanup()
def features(self, **kwargs):
out = io.StringIO()
# Пустые DLSS_SDK/VULKAN_SDK — «не заданы»: автоскачивание в этих тестах не нужно.
with patch.dict(os.environ, {"VULKAN_SDK": str(self.vulkan), "DLSS_SDK": ""}), \
contextlib.redirect_stdout(out):
return airdef.dlss_build_features(**kwargs), out.getvalue()
def test_non_windows_is_mods_even_with_rtx_and_sdk(self):
features, output = self.features(system="Darwin", gpus=["NVIDIA GeForce RTX 3060"], sdk=self.sdk)
self.assertEqual(features, "mods")
self.assertEqual(output, "")
def test_windows_without_rtx_is_mods_silently(self):
features, output = self.features(system="Windows", gpus=["Intel(R) UHD Graphics 770"], sdk=self.sdk)
self.assertEqual(features, "mods")
self.assertEqual(output, "")
def test_windows_rtx_without_sdk_warns_and_builds_mods(self):
features, output = self.features(system="Windows", gpus=["NVIDIA GeForce RTX 3060"],
sdk=self.root / "missing")
self.assertEqual(features, "mods")
self.assertIn("DLSS_SDK", output)
self.assertIn("RTX", output)
def test_windows_rtx_without_vulkan_sdk_warns_and_builds_mods(self):
with patch.dict(os.environ, {"VULKAN_SDK": str(self.root / "missing")}), contextlib.redirect_stdout(io.StringIO()):
features = airdef.dlss_build_features(system="Windows", gpus=["NVIDIA GeForce RTX 3060"], sdk=self.sdk)
self.assertEqual(features, "mods")
def test_windows_rtx_with_full_toolchain_enables_dlss(self):
features, output = self.features(system="Windows", gpus=["NVIDIA GeForce RTX 3060", "Intel(R) UHD"],
sdk=self.sdk)
self.assertEqual(features, "mods,dlss")
self.assertIn("mods,dlss", output)
def test_gpu_query_failure_means_no_dlss(self):
with patch.object(airdef.platform, "system", return_value="Windows"), \
patch.object(airdef.subprocess, "run", side_effect=OSError("no powershell")):
self.assertEqual(airdef.gpu_names(), [])
self.assertEqual(airdef.dlss_build_features(system="Windows", gpus=[]), "mods")
def test_sdk_path_requires_the_layout_dlss_wgpu_builds_with(self):
with patch.dict(os.environ, {"DLSS_SDK": str(self.sdk)}):
self.assertEqual(airdef.dlss_sdk_path(), self.sdk)
with patch.dict(os.environ, {"DLSS_SDK": str(self.root / "missing")}):
self.assertIsNone(airdef.dlss_sdk_path())
def test_game_builds_with_the_detected_feature_string(self):
commands = []
plan = {"features": "mods,dlss", "env": {}, "sdk": self.sdk, "dll": None}
with patch.object(airdef, "fork"), patch.object(airdef, "cargo", return_value="cargo"), \
patch.object(airdef, "run", side_effect=lambda cmd, cwd=None, env=None: commands.append(cmd)), \
patch.object(airdef, "dlss_build_plan", return_value=plan), \
patch.object(airdef, "place_dlss_runtime"):
airdef.game()
self.assertEqual(commands[-1][-1], "mods,dlss")
class FakeResponse:
"""Мини-ответ urlopen: поток чтения и Content-Length, как у настоящего HTTP-ответа."""
def __init__(self, payload, total=None):
self.payload = payload
self.pos = 0
self.headers = {"Content-Length": str(len(payload) if total is None else total)}
def read(self, size=-1):
chunk = self.payload[self.pos:self.pos + size]
self.pos += len(chunk)
return chunk
def __enter__(self):
return self
def __exit__(self, *exc):
return False
class DownloadTests(unittest.TestCase):
"""download(): поток, атомарная замена и явная ошибка на неполном файле."""
def setUp(self):
self.tmp = tempfile.TemporaryDirectory(prefix="airdef-download-test-")
self.addCleanup(self.tmp.cleanup)
self.root = Path(self.tmp.name)
def test_download_writes_file_and_leaves_no_part(self):
with patch.object(airdef, "open_url", return_value=FakeResponse(b"payload")):
airdef.download("https://example.invalid/a.bin", self.root / "sub" / "a.bin")
self.assertEqual((self.root / "sub" / "a.bin").read_bytes(), b"payload")
self.assertFalse((self.root / "sub" / "a.bin.part").exists())
def test_truncated_download_fails_without_placing_the_file(self):
with patch.object(airdef, "open_url", return_value=FakeResponse(b"short", total=100)):
with self.assertRaises(airdef.DownloadError):
airdef.download("https://example.invalid/a.bin", self.root / "a.bin")
self.assertFalse((self.root / "a.bin").exists())
self.assertFalse((self.root / "a.bin.part").exists())
def test_network_error_is_wrapped_as_download_error(self):
with patch.object(airdef, "open_url", side_effect=OSError("no route")):
with self.assertRaises(airdef.DownloadError):
airdef.download("https://example.invalid/a.bin", self.root / "a.bin")
class DlssVersionTests(unittest.TestCase):
"""Выбор тега: самый новый v310.9.x, при сбое API — закреплённый v310.9.1."""
def test_picks_newest_v310_9_x(self):
tags = [{"name": "v310.9.9"}, {"name": "v310.9.16"}, {"name": "v310.7.0"}, {"name": "docs"}]
with patch.object(airdef, "github_json", return_value=tags), contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(airdef.dlss_latest_tag(), "v310.9.16")
def test_api_failure_falls_back_to_pinned_tag(self):
out = io.StringIO()
with patch.object(airdef, "github_json", side_effect=OSError("rate limited")), \
contextlib.redirect_stdout(out):
self.assertEqual(airdef.dlss_latest_tag(), airdef.DLSS_TAG_PINNED)
self.assertIn("v310.9.1", out.getvalue())
def test_include_list_comes_from_api(self):
entries = [{"name": "nvsdk_ngx.h"}, {"name": "README.md"}]
with patch.object(airdef, "github_json", return_value=entries):
self.assertEqual(airdef.dlss_include_files("v310.9.16"), ["nvsdk_ngx.h"])
def test_include_list_falls_back_to_pinned_names(self):
with patch.object(airdef, "github_json", side_effect=OSError("offline")):
names = airdef.dlss_include_files("v310.9.16")
self.assertIn("nvsdk_ngx.h", names)
self.assertIn("nvsdk_ngx_helpers_vk.h", names)
self.assertIn("nvsdk_ngx_helpers_dlssd_vk.h", names)
class DlssAutoInstallTests(unittest.TestCase):
"""install_dlss_sdk/install_vulkan_headers: раскладка кэша, маркер и повторное использование."""
def setUp(self):
self.tmp = tempfile.TemporaryDirectory(prefix="airdef-dlss-install-")
self.addCleanup(self.tmp.cleanup)
self.cache = Path(self.tmp.name)
self.dlss_cache = self.cache / "dlss-sdk"
self.vulkan_cache = self.cache / "vulkan-headers"
self.downloads = []
self.offline = set()
patches = [
patch.object(airdef, "DLSS_CACHE", self.dlss_cache),
patch.object(airdef, "VULKAN_CACHE", self.vulkan_cache),
patch.object(airdef, "dlss_latest_tag", return_value="v310.9.16"),
patch.object(airdef, "dlss_include_files",
return_value=["nvsdk_ngx.h", "nvsdk_ngx_helpers_vk.h"]),
patch.object(airdef, "download", side_effect=self.fake_download),
]
for item in patches:
item.start()
self.addCleanup(item.stop)
def fake_download(self, url, dest):
if url in self.offline:
raise airdef.DownloadError(f"{url}: simulated offline")
self.downloads.append((url, Path(dest)))
Path(dest).parent.mkdir(parents=True, exist_ok=True)
Path(dest).write_bytes(b"binary" * 4)
def test_dlss_install_lays_out_exactly_what_build_rs_needs(self):
root = airdef.install_dlss_sdk()
self.assertEqual(root, self.dlss_cache / "v310.9.16")
expected = ["include/nvsdk_ngx.h", "include/nvsdk_ngx_helpers_vk.h",
*airdef.DLSS_LIBS, airdef.DLSS_RUNTIME]
for rel in expected:
self.assertTrue((root / rel).is_file(), rel)
marker = json.loads((root / airdef.INSTALL_MARKER).read_text(encoding="utf-8"))
self.assertEqual(marker["tag"], "v310.9.16")
self.assertEqual(marker["dll_bytes"], 24)
self.assertEqual(len(self.downloads), len(expected))
self.assertTrue(all("/v310.9.16/" in url for url, _ in self.downloads))
self.assertEqual([p.name for p in self.dlss_cache.iterdir()], ["v310.9.16"])
def test_second_install_is_a_cache_hit_without_downloads(self):
first = airdef.install_dlss_sdk()
count = len(self.downloads)
out = io.StringIO()
with contextlib.redirect_stdout(out):
second = airdef.install_dlss_sdk()
self.assertEqual(first, second)
self.assertEqual(len(self.downloads), count)
self.assertIn("кэше", out.getvalue())
def test_failed_download_removes_staging_and_installs_nothing(self):
dll_url = airdef.DLSS_RAW.format(tag="v310.9.16", path=airdef.DLSS_RUNTIME)
self.offline.add(dll_url)
with contextlib.redirect_stdout(io.StringIO()):
with self.assertRaises(airdef.DownloadError):
airdef.install_dlss_sdk()
self.assertFalse((self.dlss_cache / "v310.9.16").exists())
self.assertEqual([p.name for p in self.dlss_cache.iterdir()], [])
def test_damaged_cache_is_reinstalled(self):
root = airdef.install_dlss_sdk()
(root / airdef.DLSS_RUNTIME).unlink()
count = len(self.downloads)
with contextlib.redirect_stdout(io.StringIO()):
airdef.install_dlss_sdk()
self.assertTrue((root / airdef.DLSS_RUNTIME).is_file())
self.assertGreater(len(self.downloads), count)
def test_vulkan_headers_land_under_capital_include(self):
root = airdef.install_vulkan_headers()
self.assertEqual(root, self.vulkan_cache / airdef.VULKAN_TAG_PINNED)
self.assertTrue((root / "Include" / "vulkan" / "vulkan.h").is_file())
self.assertTrue((root / "Include" / "vk_video" / "vulkan_video_codecs_common.h").is_file())
self.assertTrue((root / airdef.INSTALL_MARKER).is_file())
count = len(self.downloads)
with contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(airdef.install_vulkan_headers(), root)
self.assertEqual(len(self.downloads), count)
class DlssBuildPlanTests(unittest.TestCase):
"""План сборки: автоскачивание, приоритет явных переменных и деградация до mods."""
def setUp(self):
self.tmp = tempfile.TemporaryDirectory(prefix="airdef-dlss-plan-")
self.addCleanup(self.tmp.cleanup)
self.root = Path(self.tmp.name)
self.sdk = self.root / "DLSS"
(self.sdk / "include").mkdir(parents=True)
(self.sdk / "include" / "nvsdk_ngx.h").write_text("")
(self.sdk / "lib" / "Windows_x86_64" / "x64").mkdir(parents=True)
(self.sdk / airdef.DLSS_RUNTIME).parent.mkdir(parents=True)
(self.sdk / airdef.DLSS_RUNTIME).write_bytes(b"dll")
self.vulkan = self.root / "VulkanSDK"
(self.vulkan / "Include" / "vulkan").mkdir(parents=True)
(self.vulkan / "Include" / "vulkan" / "vulkan.h").write_text("")
def plan(self, env=None, **kwargs):
out = io.StringIO()
baseline = {"DLSS_SDK": "", "VULKAN_SDK": "", "AIRDEF_GAME": ""}
baseline.update(env or {})
with patch.dict(os.environ, baseline), contextlib.redirect_stdout(out):
return airdef.dlss_build_plan(**kwargs), out.getvalue()
def test_non_windows_never_downloads(self):
with patch.object(airdef, "install_dlss_sdk", side_effect=AssertionError("download attempted")), \
patch.object(airdef, "install_vulkan_headers", side_effect=AssertionError("download attempted")):
plan, output = self.plan(system="Darwin", gpus=["NVIDIA GeForce RTX 3060"])
self.assertEqual(plan["features"], "mods")
self.assertEqual(plan["env"], {})
self.assertEqual(output, "")
def test_windows_without_rtx_never_downloads(self):
with patch.object(airdef, "install_dlss_sdk", side_effect=AssertionError("download attempted")), \
patch.object(airdef, "install_vulkan_headers", side_effect=AssertionError("download attempted")):
plan, output = self.plan(system="Windows", gpus=["Intel(R) UHD Graphics 770"])
self.assertEqual(plan["features"], "mods")
self.assertEqual(output, "")
def test_windows_rtx_auto_installs_and_wires_env(self):
with patch.object(airdef, "dlss_sdk_path", return_value=None), \
patch.object(airdef, "cached_dlss_sdk", return_value=None), \
patch.object(airdef, "cached_vulkan_headers", return_value=None), \
patch.object(airdef, "install_dlss_sdk", return_value=self.sdk) as dlss_install, \
patch.object(airdef, "install_vulkan_headers", return_value=self.vulkan) as vulkan_install:
plan, output = self.plan(system="Windows", gpus=["NVIDIA GeForce RTX 3060"])
dlss_install.assert_called_once_with()
vulkan_install.assert_called_once_with()
self.assertEqual(plan["features"], "mods,dlss")
self.assertEqual(plan["env"], {"DLSS_SDK": str(self.sdk), "VULKAN_SDK": str(self.vulkan)})
self.assertEqual(plan["sdk"], self.sdk)
self.assertEqual(plan["dll"], self.sdk / airdef.DLSS_RUNTIME)
self.assertIn("mods,dlss", output)
def test_install_failure_degrades_to_mods_with_warning(self):
with patch.object(airdef, "dlss_sdk_path", return_value=None), \
patch.object(airdef, "cached_dlss_sdk", return_value=None), \
patch.object(airdef, "cached_vulkan_headers", return_value=None), \
patch.object(airdef, "install_dlss_sdk", side_effect=airdef.DownloadError("нет сети")), \
patch.object(airdef, "install_vulkan_headers", return_value=self.vulkan):
plan, output = self.plan(system="Windows", gpus=["NVIDIA GeForce RTX 3060"])
self.assertEqual(plan["features"], "mods")
self.assertEqual(plan["env"], {})
self.assertIsNone(plan["sdk"])
self.assertIn("не скачался", output)
self.assertIn("нет сети", output)
self.assertIn("TAAU", output)
def test_explicit_env_wins_and_skips_download(self):
env = {"DLSS_SDK": str(self.sdk), "VULKAN_SDK": str(self.vulkan)}
with patch.object(airdef, "install_dlss_sdk", side_effect=AssertionError("download attempted")), \
patch.object(airdef, "install_vulkan_headers", side_effect=AssertionError("download attempted")):
plan, _ = self.plan(env=env, system="Windows", gpus=["NVIDIA GeForce RTX 3060"])
self.assertEqual(plan["features"], "mods,dlss")
self.assertEqual(plan["env"], env)
self.assertEqual(plan["sdk"], self.sdk)
def test_explicit_but_invalid_env_does_not_silently_download(self):
env = {"DLSS_SDK": str(self.root / "missing"), "VULKAN_SDK": str(self.vulkan)}
with patch.object(airdef, "install_dlss_sdk", side_effect=AssertionError("download attempted")):
plan, output = self.plan(env=env, system="Windows", gpus=["NVIDIA GeForce RTX 3060"])
self.assertEqual(plan["features"], "mods")
self.assertIn("путь неполный", output)
def test_cached_sdk_is_used_without_download(self):
with patch.object(airdef, "dlss_sdk_path", return_value=None), \
patch.object(airdef, "cached_dlss_sdk", return_value=self.sdk), \
patch.object(airdef, "cached_vulkan_headers", return_value=self.vulkan), \
patch.object(airdef, "install_dlss_sdk", side_effect=AssertionError("download attempted")), \
patch.object(airdef, "install_vulkan_headers", side_effect=AssertionError("download attempted")):
plan, _ = self.plan(system="Windows", gpus=["NVIDIA GeForce RTX 3060"])
self.assertEqual(plan["features"], "mods,dlss")
self.assertEqual(plan["sdk"], self.sdk)
def test_game_passes_env_and_copies_dll_after_success(self):
plan = {"features": "mods,dlss", "env": {"DLSS_SDK": str(self.sdk), "VULKAN_SDK": str(self.vulkan)},
"sdk": self.sdk, "dll": self.sdk / airdef.DLSS_RUNTIME}
calls = []
def fake_run(cmd, cwd=None, env=None):
calls.append({"cmd": cmd, "cwd": cwd, "env": env})
with patch.object(airdef, "fork"), patch.object(airdef, "cargo", return_value="cargo"), \
patch.object(airdef, "dlss_build_plan", return_value=plan), \
patch.object(airdef, "run", side_effect=fake_run), \
patch.object(airdef, "place_dlss_runtime") as place:
airdef.game()
self.assertEqual(calls[0]["cmd"][-1], "mods,dlss")
self.assertEqual(calls[0]["env"]["DLSS_SDK"], str(self.sdk))
self.assertEqual(calls[0]["env"]["VULKAN_SDK"], str(self.vulkan))
place.assert_called_once_with(self.sdk)
def test_game_without_dlss_does_not_touch_the_runtime_dll(self):
plan = {"features": "mods", "env": {}, "sdk": None, "dll": None}
with patch.object(airdef, "fork"), patch.object(airdef, "cargo", return_value="cargo"), \
patch.object(airdef, "dlss_build_plan", return_value=plan), \
patch.object(airdef, "run"), patch.object(airdef, "place_dlss_runtime") as place:
airdef.game()
place.assert_not_called()
class PlaceDlssRuntimeTests(unittest.TestCase):
"""nvngx_dlss.dll кладётся рядом с собранным клиентом; без клиента — только предупреждение."""
def setUp(self):
self.tmp = tempfile.TemporaryDirectory(prefix="airdef-dlss-place-")
self.addCleanup(self.tmp.cleanup)
self.root = Path(self.tmp.name)
self.fork = self.root / "horizon"
self.sdk = self.root / "DLSS"
(self.sdk / airdef.DLSS_RUNTIME).parent.mkdir(parents=True)
(self.sdk / airdef.DLSS_RUNTIME).write_bytes(b"fresh-dlss-dll")
self.patches = [
patch.object(airdef, "ROOT", self.root),
patch.object(airdef, "FORK", self.fork),
patch.dict(os.environ, {"AIRDEF_GAME": ""}),
]
for item in self.patches:
item.start()
self.addCleanup(item.stop)
def build(self):
exe = self.fork / "target" / "fast" / ("horizon-client" + airdef.EXE)
exe.parent.mkdir(parents=True)
exe.write_bytes(b"exe")
return exe
def test_dll_lands_beside_the_built_client(self):
exe = self.build()
out = io.StringIO()
with contextlib.redirect_stdout(out):
target = airdef.place_dlss_runtime(self.sdk)
self.assertEqual(target, exe.with_name("nvngx_dlss.dll"))
self.assertEqual(target.read_bytes(), b"fresh-dlss-dll")
self.assertIn("nvngx_dlss.dll", out.getvalue())
def test_stale_dll_is_replaced_by_the_fresh_one(self):
exe = self.build()
target = exe.with_name("nvngx_dlss.dll")
target.write_bytes(b"stale-dll-here")
with contextlib.redirect_stdout(io.StringIO()):
airdef.place_dlss_runtime(self.sdk)
self.assertEqual(target.read_bytes(), b"fresh-dlss-dll")
def test_missing_client_warns_instead_of_failing(self):
out = io.StringIO()
with contextlib.redirect_stdout(out):
self.assertIsNone(airdef.place_dlss_runtime(self.sdk))
self.assertIn("вручную", out.getvalue())
if __name__ == "__main__":
unittest.main()