mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-23 08:55:44 +08:00
Merge pull request #2705 from langbot-app/test/required-contract-suites
test(ci): decouple required suites from test names and counts
This commit is contained in:
@@ -12,12 +12,17 @@ This test verifies that:
|
||||
import ast
|
||||
import pathlib
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.security
|
||||
|
||||
# Resolve project root (one level up from tests/)
|
||||
_PROJECT_ROOT = pathlib.Path(__file__).resolve().parent.parent
|
||||
|
||||
VULN_FILE = _PROJECT_ROOT / 'src' / 'langbot' / 'pkg' / 'api' / 'http' / 'controller' / 'groups' / 'system.py'
|
||||
|
||||
|
||||
@pytest.mark.contract('debug_exec_absent')
|
||||
def test_no_exec_call_in_system_controller():
|
||||
"""Verify there is no exec() call in system.py that takes user input."""
|
||||
with open(VULN_FILE, 'r') as f:
|
||||
@@ -38,6 +43,7 @@ def test_no_exec_call_in_system_controller():
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.contract('debug_route_absent')
|
||||
def test_no_debug_exec_route():
|
||||
"""Verify the /debug/exec route is not registered."""
|
||||
with open(VULN_FILE, 'r') as f:
|
||||
|
||||
Reference in New Issue
Block a user