test_governance_document_builder.py 518 B

123456
  1. def test_document_builder_is_deterministic_and_redacts_secrets():
  2. from app.core.knowledge.document_builder import build_document
  3. first = build_document("DataFlow", {"uid": "u", "name": "Flow", "version": 1, "password": "secret", "relations": [{"b": 2}, {"a": 1}]})
  4. second = build_document("DataFlow", {"relations": [{"a": 1}, {"b": 2}], "version": 1, "name": "Flow", "uid": "u", "password": "changed"})
  5. assert first["content_hash"] == second["content_hash"]
  6. assert "secret" not in first["content"]