fix: update 6 test files broken by dead code removal

- test_percentage_clamp.py: remove TestContextCompressorUsagePercent class
  and test_context_compressor_clamped (tested removed get_status() method)
- test_credential_pool.py: remove test_mark_used_increments_request_count
  (tested removed mark_used()), replace active_lease_count() calls with
  direct _active_leases dict access, remove mark_used from thread test
- test_session.py: replace SessionSource.local_cli() factory calls with
  direct SessionSource construction (local_cli classmethod removed)
- test_error_classifier.py: remove test_is_transient_property (tested
  removed is_transient property on ClassifiedError)
- test_delivery.py: remove TestDeliveryRouter class (tested removed
  resolve_targets method), clean up unused imports
- test_skills_hub.py: remove test_is_hub_installed (tested removed
  is_hub_installed method on HubLockFile)
This commit is contained in:
Teknium
2026-04-10 03:07:47 -07:00
committed by Teknium
parent c6c769772f
commit 957485876b
6 changed files with 18 additions and 147 deletions

View File

@@ -1,7 +1,7 @@
"""Tests for the delivery routing module."""
from gateway.config import Platform, GatewayConfig, PlatformConfig, HomeChannel
from gateway.delivery import DeliveryRouter, DeliveryTarget
from gateway.config import Platform
from gateway.delivery import DeliveryTarget
from gateway.session import SessionSource
@@ -65,10 +65,4 @@ class TestTargetToStringRoundtrip:
assert reparsed.chat_id == "999"
class TestDeliveryRouter:
def test_resolve_targets_does_not_duplicate_local_when_explicit(self):
router = DeliveryRouter(GatewayConfig(always_log_local=True))
targets = router.resolve_targets(["local"])
assert [target.platform for target in targets] == [Platform.LOCAL]

View File

@@ -90,7 +90,10 @@ class TestSessionSourceRoundtrip:
class TestSessionSourceDescription:
def test_local_cli(self):
source = SessionSource.local_cli()
source = SessionSource(
platform=Platform.LOCAL, chat_id="cli",
chat_name="CLI terminal", chat_type="dm",
)
assert source.description == "CLI terminal"
def test_dm_with_username(self):
@@ -143,7 +146,10 @@ class TestSessionSourceDescription:
class TestLocalCliFactory:
def test_local_cli_defaults(self):
source = SessionSource.local_cli()
source = SessionSource(
platform=Platform.LOCAL, chat_id="cli",
chat_name="CLI terminal", chat_type="dm",
)
assert source.platform == Platform.LOCAL
assert source.chat_id == "cli"
assert source.chat_type == "dm"
@@ -267,7 +273,10 @@ class TestBuildSessionContextPrompt:
def test_local_prompt_mentions_machine(self):
config = GatewayConfig()
source = SessionSource.local_cli()
source = SessionSource(
platform=Platform.LOCAL, chat_id="cli",
chat_name="CLI terminal", chat_type="dm",
)
ctx = build_session_context(source, config)
prompt = build_session_context_prompt(ctx)