|
4 | 4 |
|
5 | 5 | import importlib.util |
6 | 6 | import json |
| 7 | +import re |
7 | 8 | import sys |
8 | 9 | import tomllib |
9 | 10 | from pathlib import Path |
@@ -52,6 +53,27 @@ def adapted_kernel_task(tmp_path: Path) -> Path: |
52 | 53 | ) |
53 | 54 |
|
54 | 55 |
|
| 56 | +def test_redcross_task_intercepts_zip_lookup_not_chapter_finder_page() -> None: |
| 57 | + task_path = ( |
| 58 | + REPO_ROOT |
| 59 | + / "test-cases" |
| 60 | + / "v2" |
| 61 | + / "v2-1134-chapter-finder-redcross" |
| 62 | + / "task.json" |
| 63 | + ) |
| 64 | + schema = json.loads(task_path.read_text())["eval_schema"] |
| 65 | + |
| 66 | + assert not re.search( |
| 67 | + schema["url_pattern"], |
| 68 | + "https://www.redcross.org/find-your-local-chapter.html", |
| 69 | + ) |
| 70 | + assert re.search( |
| 71 | + schema["url_pattern"], |
| 72 | + "https://www.redcross.org/api/lookup/v1/region-mappings/90210?type=RCO", |
| 73 | + ) |
| 74 | + assert schema["params"] == {"type": "RCO"} |
| 75 | + |
| 76 | + |
55 | 77 | def test_kernel_runtime_selection_writes_bridge_env_and_pinned_mcp( |
56 | 78 | adapted_kernel_task: Path, |
57 | 79 | ) -> None: |
@@ -229,7 +251,11 @@ def __init__(self) -> None: |
229 | 251 | cdp_url="wss://kernel.example/browser/sess-123/cdp?token=secret-token", |
230 | 252 | viewer_url="https://kernel.example/live/sess-123", |
231 | 253 | viewer_url_sensitive=True, |
232 | | - metadata={"replay_id": "replay-9", "region": "us-east"}, |
| 254 | + metadata={ |
| 255 | + "replay_id": "replay-9", |
| 256 | + "region": "us-east", |
| 257 | + "stealth": False, |
| 258 | + }, |
233 | 259 | recording_mode="provider-download", |
234 | 260 | ) |
235 | 261 |
|
@@ -304,6 +330,7 @@ def test_start_writes_state_and_credential_free_metadata( |
304 | 330 | metadata = json.loads(module.METADATA_FILE.read_text()) |
305 | 331 | assert metadata["session_id"] == "sess-123" |
306 | 332 | assert metadata["replay_id"] == "replay-9" |
| 333 | + assert metadata["stealth"] is False |
307 | 334 | assert metadata["cdp_bridge_url"] == "http://127.0.0.1:7878" |
308 | 335 | blob = module.METADATA_FILE.read_text() |
309 | 336 | assert "k-test-key" not in blob |
|
0 commit comments