MCPcopy
hub / github.com/coderamp-labs/gitingest / test_process_notebook_raw_only

Function test_process_notebook_raw_only

tests/test_notebook_utils.py:161–180  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

159
160
161def 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
183def test_process_notebook_empty_cells(write_notebook: WriteNotebookFunc) -> None:

Callers

nothing calls this directly

Calls 2

process_notebookFunction · 0.90
write_notebookFunction · 0.85

Tested by

no test coverage detected