Home / Function/ test_level_mismatch_2() — fastapi Function Reference

test_level_mismatch_2() — fastapi Function Reference

Architecture documentation for the test_level_mismatch_2() function in test_header_level_mismatch.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  9e24d0b0_4442_2249_9d4c_f63005104b1a["test_level_mismatch_2()"]
  ea780e59_0602_ee14_b646_ddf831d7faec["test_header_level_mismatch.py"]
  9e24d0b0_4442_2249_9d4c_f63005104b1a -->|defined in| ea780e59_0602_ee14_b646_ddf831d7faec
  style 9e24d0b0_4442_2249_9d4c_f63005104b1a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/tests/test_translation_fixer/test_header_permalinks/test_header_level_mismatch.py lines 43–60

def test_level_mismatch_2(runner: CliRunner, root_dir: Path, copy_test_files):
    result = runner.invoke(
        cli,
        ["fix-pages", "docs/lang/docs/doc.md"],
    )
    assert result.exit_code == 1

    fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
    expected_content = Path(
        f"{data_path}/translated_doc_level_mismatch_2.md"
    ).read_text("utf-8")

    assert fixed_content == expected_content  # Translated doc remains unchanged
    assert "Error processing docs/lang/docs/doc.md" in result.output
    assert (
        "Header levels do not match between document and original document"
        " (found ##, expected #) for header №4 in line 13"
    ) in result.output

Domain

Subdomains

Frequently Asked Questions

What does test_level_mismatch_2() do?
test_level_mismatch_2() is a function in the fastapi codebase, defined in scripts/tests/test_translation_fixer/test_header_permalinks/test_header_level_mismatch.py.
Where is test_level_mismatch_2() defined?
test_level_mismatch_2() is defined in scripts/tests/test_translation_fixer/test_header_permalinks/test_header_level_mismatch.py at line 43.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free