CoolFace
Apppublic

mrme77/dfars-assistant

sourceHugging Faceupdated 1mo agoView on Hugging Face
0likes
test_detect_sections.py35 linesDownload Raw Back to tests
1"""Tests for DFARS section heading detection."""2 3from src.ingestion.detect_sections import detect_section_heading4 5 6def test_detects_standard_section_heading() -> None:7    """It detects a normal DFARS section heading."""8    result = detect_section_heading("204.7302 Policy.")9 10    assert result == ("204.7302", "Policy.")11 12 13def test_detects_clause_heading() -> None:14    """It detects a DFARS clause heading."""15    result = detect_section_heading("252.204-7012 Safeguarding Covered Defense Information.")16 17    assert result == (18        "252.204-7012",19        "Safeguarding Covered Defense Information.",20    )21 22 23def test_returns_none_for_body_text() -> None:24    """It ignores body text that is not a section heading."""25    result = detect_section_heading("The contractor shall provide adequate security.")26 27    assert result is None28 29 30def test_returns_none_for_cross_reference_body_line() -> None:31    """It ignores body text that starts with a DFARS reference."""32    result = detect_section_heading("252.232-7003 unless one of the exceptions applies.")33 34    assert result is None35