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

Function test_process_notebook_markdown_only

tests/test_notebook_utils.py:139–158  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

137
138
139def 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
161def test_process_notebook_raw_only(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