feat: classify gear and weapon mods
This commit is contained in:
@@ -25,6 +25,7 @@ from game_data_capture.runtime import (
|
||||
_CaptureControl,
|
||||
)
|
||||
from game_data_capture.storage import CaptureCorpus, CaptureRepository, StorageDatabase
|
||||
from game_data_capture.web.app import WebConfig
|
||||
|
||||
_PNG = PNG_SIGNATURE + b"unit-png"
|
||||
|
||||
@@ -451,6 +452,37 @@ def test_serve_constructs_durable_corpus_without_auto_arming_and_uses_one_fragme
|
||||
reusable.release()
|
||||
|
||||
|
||||
def test_serve_loads_bounded_corpus_history_independently_of_intake_capacity(
|
||||
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
|
||||
) -> None:
|
||||
runtime = CaptureRuntime(
|
||||
AppConfig(
|
||||
limits=CaptureLimits(max_queue_items=64),
|
||||
lifecycle=LifecycleConfig(lock_timeout_seconds=0),
|
||||
),
|
||||
_paths(tmp_path),
|
||||
migrations_dir=(Path(__file__).parents[3] / "migrations").resolve(),
|
||||
)
|
||||
captured: dict[str, object] = {}
|
||||
|
||||
def factory(**kwargs: object) -> object:
|
||||
captured.update(kwargs)
|
||||
return object()
|
||||
|
||||
def runner(_: object, **__: object) -> None:
|
||||
control = cast(_CaptureControl, captured["capture_control"])
|
||||
assert control.status().queue_capacity == runtime.config.limits.max_queue_items
|
||||
|
||||
monkeypatch.setattr(runtime_module, "create_app", factory)
|
||||
monkeypatch.setattr(uvicorn, "run", runner)
|
||||
|
||||
runtime.serve()
|
||||
|
||||
web_config = cast(WebConfig, captured["config"])
|
||||
assert web_config.max_capture_items == 256
|
||||
assert web_config.max_capture_items > runtime.config.limits.max_queue_items
|
||||
|
||||
|
||||
def test_service_startup_reconciliation_failure_releases_the_instance_lock(
|
||||
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user