Tests for ADR Rubric Generator and Rubric Merger (H.3.2.6).
Tests cover:
- ADR parsing and frontmatter extraction
- Constraint extraction (MUST/SHOULD/MAY patterns)
- Technical term detection
- Rubric generation logic
- Weight normalization
- Batch processing
- Rubric merger functionality
- Edge cases
File: test_adr_rubric_generator.py
Classes
TestADRParser
Tests for ADRParser class.
TestConstraintExtraction
Tests for constraint extraction patterns.
TestRubricGeneration
Tests for rubric generation logic.
TestWeightNormalization
Tests for weight normalization.
TestEdgeCases
Tests for edge cases.
TestRubricMerger
Tests for RubricMerger class.
TestMergeStrategies
Tests for different merge strategies.
TestMergeConvenienceFunctions
Tests for merge convenience functions.
TestMergedDimension
Tests for MergedDimension class.
TestMergeConfig
Tests for MergeConfig class.
Functions
setUp()
Set up test fixtures.
test_parser_initialization()
Test parser initializes with compiled patterns.
test_parse_simple_yaml_frontmatter()
Test parsing simple YAML frontmatter.
test_parse_yaml_with_list()
Test parsing YAML with list values.
test_extract_sections()
Test section extraction from markdown.
setUp()
Set up test fixtures.
test_extract_must_constraints()
Test extraction of MUST-level constraints.
test_extract_should_constraints()
Test extraction of SHOULD-level constraints.
test_extract_may_constraints()
Test extraction of MAY-level constraints.
test_extract_technical_terms()
Test extraction of technical terms.
test_constraint_source_tracking()
Test that constraints track their source section.
test_no_constraints_in_context()
Test that context section is not searched by default.
setUp()
Set up test fixtures.
test_generate_rubric_from_constraints()
Test rubric generation from constraints.
test_dimension_has_required_fields()
Test that generated dimensions have all required fields.
Usage
python test_adr_rubric_generator.py