Test a notebook with only markdown cells. Given a notebook with two markdown cells: When ``process_notebook`` is called, Then each markdown cell should become a triple-quoted block (2 blocks => 4 triple quotes total).
(write_notebook: WriteNotebookFunc)
| 137 | |
| 138 | |
| 139 | def test_process_notebook_markdown_only(write_notebook: WriteNotebookFunc) -> None: |
| 140 | """Test a notebook with only markdown cells. |
| 141 | |
| 142 | Given a notebook with two markdown cells: |
| 143 | When ``process_notebook`` is called, |
| 144 | Then each markdown cell should become a triple-quoted block (2 blocks => 4 triple quotes total). |
| 145 | """ |
| 146 | expected_count = 4 |
| 147 | notebook_content = { |
| 148 | "cells": [ |
| 149 | {"cell_type": "markdown", "source": ["# Markdown Header"]}, |
| 150 | {"cell_type": "markdown", "source": ["Some more markdown."]}, |
| 151 | ], |
| 152 | } |
| 153 | nb_path = write_notebook("markdown_only.ipynb", notebook_content) |
| 154 | result = process_notebook(nb_path) |
| 155 | |
| 156 | assert result.count('"""') == expected_count, "Two markdown cells => 2 blocks => 4 triple quotes total." |
| 157 | assert "# Markdown Header" in result |
| 158 | assert "Some more markdown." in result |
| 159 | |
| 160 | |
| 161 | def test_process_notebook_raw_only(write_notebook: WriteNotebookFunc) -> None: |
nothing calls this directly
no test coverage detected