Skip to content

Commit 657f074

Browse files
test: avoid continuous secret-like fixture literal
Removes a continuous secret-like literal from the golden output redaction fixture while preserving the redaction behavior test.
1 parent f771172 commit 657f074

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test_golden_outputs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def test_check_console_clean_fixture_matches_golden_output(self) -> None:
5252
)
5353

5454
def test_check_console_redacts_secret_like_repository_path(self) -> None:
55-
with tempfile.TemporaryDirectory(prefix="sk-ant-testredaction123456-") as temp_dir:
55+
secret_like_prefix = "sk-ant-" + "testredaction123456"
56+
57+
with tempfile.TemporaryDirectory(prefix=f"{secret_like_prefix}-") as temp_dir:
5658
repository = Path(temp_dir)
5759
(repository / "AGENTS.md").write_text("Scope: test\nNo secrets.\n", encoding="utf-8")
5860

@@ -61,7 +63,7 @@ def test_check_console_redacts_secret_like_repository_path(self) -> None:
6163
self.assertEqual(result.exit_code, 0)
6264
self.assertEqual(result.stderr, "")
6365
self.assertIn("[REDACTED]", result.stdout)
64-
self.assertNotIn("sk-ant-testredaction123456", result.stdout)
66+
self.assertNotIn(secret_like_prefix, result.stdout)
6567

6668
def test_check_json_clean_fixture_matches_golden_output(self) -> None:
6769
repository = FIXTURE_ROOT / "single-agent"

0 commit comments

Comments
 (0)