test: repoint percentage-clamp source guard to gateway/slash_commands.py
test_gateway_run_clamped read gateway/run.py asserting the /usage stats handler clamps pct with min(100, ...). That handler moved to gateway/slash_commands.py in this PR's extraction; repoint the guard so it still fires on clamp removal. tests/run_agent/ + tests/gateway/ 8024 passed / 0 failed.
This commit is contained in:
@@ -81,10 +81,12 @@ class TestSourceLinesAreClamped:
|
||||
return f.read()
|
||||
|
||||
def test_gateway_run_clamped(self):
|
||||
src = self._read_file("gateway/run.py")
|
||||
# The /usage stats handler was extracted from gateway/run.py into
|
||||
# gateway/slash_commands.py (god-file decomposition Phase 3b).
|
||||
src = self._read_file("gateway/slash_commands.py")
|
||||
# Check that the stats handler has min(100, ...)
|
||||
assert "min(100, ctx.last_prompt_tokens" in src, (
|
||||
"gateway/run.py stats pct is not clamped with min(100, ...)"
|
||||
"gateway/slash_commands.py stats pct is not clamped with min(100, ...)"
|
||||
)
|
||||
|
||||
def test_cli_clamped(self):
|
||||
|
||||
Reference in New Issue
Block a user