Test a notebook with only raw cells. Given two raw cells: When ``process_notebook`` is called, Then each raw cell should become a triple-quoted block (2 blocks => 4 triple quotes total).
(write_notebook: WriteNotebookFunc)
| 159 | |
| 160 | |
| 161 | def test_process_notebook_raw_only(write_notebook: WriteNotebookFunc) -> None: |
| 162 | """Test a notebook with only raw cells. |
| 163 | |
| 164 | Given two raw cells: |
| 165 | When ``process_notebook`` is called, |
| 166 | Then each raw cell should become a triple-quoted block (2 blocks => 4 triple quotes total). |
| 167 | """ |
| 168 | expected_count = 4 |
| 169 | notebook_content = { |
| 170 | "cells": [ |
| 171 | {"cell_type": "raw", "source": ["Raw content line 1"]}, |
| 172 | {"cell_type": "raw", "source": ["Raw content line 2"]}, |
| 173 | ], |
| 174 | } |
| 175 | nb_path = write_notebook("raw_only.ipynb", notebook_content) |
| 176 | result = process_notebook(nb_path) |
| 177 | |
| 178 | assert result.count('"""') == expected_count, "Two raw cells => 2 blocks => 4 triple quotes." |
| 179 | assert "Raw content line 1" in result |
| 180 | assert "Raw content line 2" in result |
| 181 | |
| 182 | |
| 183 | def test_process_notebook_empty_cells(write_notebook: WriteNotebookFunc) -> None: |
nothing calls this directly
no test coverage detected