tests.test_frontmatter module

Tests for the shared YAML frontmatter splitter.

tests.test_frontmatter.test_splits_frontmatter_and_body()[source]

A well-formed block yields its mapping and the body below it.

tests.test_frontmatter.test_values_keep_yaml_types()[source]

Nested mappings and lists read back as structures, not strings.

tests.test_frontmatter.test_value_containing_delimiter_survives()[source]

A --- inside a value does not truncate the block.

The naive “split on the first two --- runs” approach cuts the block short here, dropping every field after argument-hint and leaking the remainder into the body.

tests.test_frontmatter.test_no_usable_frontmatter_returns_document_untouched(raw)[source]

Every degenerate shape yields an empty mapping and the input as body.

Returning raw rather than a stripped remainder is what keeps a malformed block from silently eating content.

tests.test_frontmatter.test_body_leading_blank_lines_are_trimmed()[source]

Blank lines between the closing delimiter and the body are dropped.