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

Function test_process_notebook_code_only

tests/test_notebook_utils.py:118–136  ·  view source on GitHub ↗

Test a notebook containing only code cells. Given a notebook with code cells only: When ``process_notebook`` is called, Then no triple quotes should appear in the output.

(write_notebook: WriteNotebookFunc)

Source from the content-addressed store, hash-verified

116
117
118def test_process_notebook_code_only(write_notebook: WriteNotebookFunc) -> None:
119 """Test a notebook containing only code cells.
120
121 Given a notebook with code cells only:
122 When ``process_notebook`` is called,
123 Then no triple quotes should appear in the output.
124 """
125 notebook_content = {
126 "cells": [
127 {"cell_type": "code", "source": ["print('Code Cell 1')"]},
128 {"cell_type": "code", "source": ["x = 42"]},
129 ],
130 }
131 nb_path = write_notebook("code_only.ipynb", notebook_content)
132 result = process_notebook(nb_path)
133
134 assert '"""' not in result, "No triple quotes expected when there are only code cells."
135 assert "print('Code Cell 1')" in result
136 assert "x = 42" in result
137
138
139def test_process_notebook_markdown_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