Home / Function/ test_level_mismatch_1() — fastapi Function Reference

test_level_mismatch_1() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

scripts/tests/test_translation_fixer/test_header_permalinks/test_header_level_mismatch.py lines 18–35

def test_level_mismatch_1(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_1.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 №2 in line 5"
    ) in result.output

Domain

Subdomains

Frequently Asked Questions

What does test_level_mismatch_1() do?
test_level_mismatch_1() 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_1() defined?
test_level_mismatch_1() is defined in scripts/tests/test_translation_fixer/test_header_permalinks/test_header_level_mismatch.py at line 18.

Analyze Your Own Codebase

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

Try Supermodel Free