mirror of
https://github.com/MaksTinyWorkshop/_Assistant_Lead_Tech
synced 2026-04-06 21:41:42 +02:00
leadtech-bmad-mcp: close lot 3 rollout and gates config
This commit is contained in:
36
mcp/leadtech_bmad_mcp/tests/test_gates.py
Normal file
36
mcp/leadtech_bmad_mcp/tests/test_gates.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from leadtech_bmad_mcp.gates import apply_text_rules, get_gate_labels, load_gates_config
|
||||
|
||||
|
||||
def test_load_gates_config_reads_yaml():
|
||||
config = load_gates_config()
|
||||
assert config["labels"]
|
||||
assert config["validate_plan"]
|
||||
assert config["validate_patch"]
|
||||
|
||||
|
||||
def test_get_gate_labels_returns_configured_labels():
|
||||
labels = get_gate_labels()
|
||||
assert "Contracts-First / Zod-Infer / No-DTO" in labels
|
||||
|
||||
|
||||
def test_apply_text_rules_triggers_backend_contracts_blocking_in_strict_mode():
|
||||
findings = apply_text_rules("validate_plan", "backend", "Plan backend sans mention de schema. Tests inclus.", strict=True)
|
||||
assert any(item["target"] == "blocking_issues" for item in findings)
|
||||
|
||||
|
||||
def test_apply_text_rules_skips_backend_contracts_blocking_in_non_strict_mode():
|
||||
findings = apply_text_rules("validate_plan", "backend", "Plan backend sans mention de schema. Tests inclus.", strict=False)
|
||||
assert not any(item["target"] == "blocking_issues" for item in findings)
|
||||
assert any(item["target"] == "must_do" for item in findings)
|
||||
|
||||
|
||||
def test_apply_text_rules_respects_required_pattern():
|
||||
findings = apply_text_rules("validate_plan", "backend", "Approche contracts-first avec Zod et tests.", strict=True)
|
||||
assert not any(item["rule_id"] == "backend_contracts" for item in findings)
|
||||
|
||||
|
||||
def test_apply_text_rules_skips_test_hint_when_tests_present():
|
||||
findings = apply_text_rules("validate_patch", "backend", "describe('x', () => { it('works', () => {}) })", strict=True)
|
||||
assert not any(item["rule_id"] == "tests_visible_in_diff" for item in findings)
|
||||
Reference in New Issue
Block a user