Orchestrata Ultimate › Tests › Reference › session › test_session_spec_parser

Tests reference — tests/session/test_session_spec_parser.py

Module of tests/session, split out because the directory page would be too large.

Prose pending.

tests/session/test_session_spec_parser.py

source · 30 tests · 409 lines

Tests for session.spec_parser — parsing spec.md and requirements.md files.

Covers: session.spec_parser

Kind Name Line Description
class TestRequirementItemInfo 28 Tests for RequirementItemInfo dataclass.
method TestRequirementItemInfo.test_to_dict 31 Test to_dict serialization.
method TestRequirementItemInfo.test_to_dict_unchecked 47 Test to_dict with unchecked item.
class TestRequirementInfo 59 Tests for RequirementInfo dataclass.
method TestRequirementInfo.test_to_dict_empty 62 Test to_dict with no items.
method TestRequirementInfo.test_to_dict_with_items 74 Test to_dict with items.
class TestSpecInfo 100 Tests for SpecInfo dataclass.
method TestSpecInfo.test_to_dict 103 Test to_dict serialization.
method TestSpecInfo.test_to_dict_with_requirements 118 Test to_dict with nested requirements.
class TestParseSpecFile 132 Tests for parse_spec_file function.
method TestParseSpecFile.test_parse_valid_spec 135 Test parsing a valid spec.md file.
method TestParseSpecFile.test_parse_spec_with_numeric_prefix 154 Test parsing spec with directory-style ID like 008-Knowledge-Graph.
method TestParseSpecFile.test_parse_spec_with_007a_prefix 167 Test parsing spec with alphabetical suffix ID.
method TestParseSpecFile.test_parse_nonexistent_file 175 Test parsing a nonexistent file returns None.
method TestParseSpecFile.test_parse_spec_no_title 180 Test parsing a file with no parseable title returns None.
method TestParseSpecFile.test_parse_spec_stops_at_user_section 187 Test parsing stops at ## User heading.
method TestParseSpecFile.test_parse_spec_metadata_without_dash_prefix 205 Test parsing metadata lines without leading dash.
class TestParseRequirementsFile 217 Tests for parse_requirements_file function.
method TestParseRequirementsFile.test_parse_standard_format 220 Test parsing FR-NNN style requirements.
method TestParseRequirementsFile.test_parse_section_heading_format 246 Test parsing ## Section Name style (spec 008 format).
method TestParseRequirementsFile.test_parse_completion_criteria_skipped 262 Test that Completion Criteria heading is skipped.
method TestParseRequirementsFile.test_parse_plain_checkbox_format 278 Test parsing plain checkboxes without bold REQ prefix.
method TestParseRequirementsFile.test_parse_nonexistent_file 294 Test parsing nonexistent file returns empty list.
method TestParseRequirementsFile.test_parse_items_without_section 299 Test items before any section heading go to 'uncategorized'.
method TestParseRequirementsFile.test_parse_plain_items_without_section 308 Test plain checkbox items before any section heading.
method TestParseRequirementsFile.test_parse_case_insensitive_checkbox 316 Test that [X] (uppercase) is treated as checked.
class TestParseAllSpecs 326 Tests for parse_all_specs function.
method TestParseAllSpecs.test_parse_empty_directory 329 Test parsing empty specs directory.
method TestParseAllSpecs.test_parse_nonexistent_directory 334 Test parsing nonexistent directory.
method TestParseAllSpecs.test_parse_full_spec_structure 339 Test parsing a complete spec directory structure.
method TestParseAllSpecs.test_parse_fallback_directory_name 357 Test fallback to directory name when no spec.md exists.
method TestParseAllSpecs.test_skip_non_numeric_directories 367 Test that non-numeric directories without valid spec are skipped.
method TestParseAllSpecs.test_parse_prompt_md_fallback 373 Test fallback to prompt.md when spec.md does not exist.
method TestParseAllSpecs.test_parse_directory_name_without_dash 386 Test fallback for directory like '003' without title part.
method TestParseAllSpecs.test_skip_files_in_specs_dir 396 Test that files (not dirs) in specs directory are skipped.
method TestParseAllSpecs.test_sorted_output 402 Test that results are sorted by directory name.