Skip to content

armgit / strix

Public Imported from GitHub
0

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

test: reject a leading heading in any finish_scan example field

Ahmed Allam0107a1529586
diff --git a/tests/test_reporting_fields.py b/tests/test_reporting_fields.py
index 86e90d62..a1887345 100644
--- a/tests/test_reporting_fields.py
+++ b/tests/test_reporting_fields.py
@@ -3,6 +3,7 @@
from __future__ import annotations
import json
+import re
from typing import TYPE_CHECKING, Any, cast
import pytest
@@ -1087,7 +1088,9 @@ def test_tool_descriptions_include_formatting_guidance() -> None:
assert "markdown" in finish_desc.lower()
assert "section body" in finish_desc.lower()
assert "do not start a field with a heading" in finish_desc.lower()
- assert "\n # Executive Summary" not in finish_desc
+ example = finish_desc.split("Example (abbreviated", 1)[1]
+ heading_lines = [line for line in example.splitlines() if re.match(r"^\s*#{1,6}\s", line)]
+ assert heading_lines == []
dep_desc = create_dependency_report.description
assert "cve" in dep_desc.lower()