MCPcopy
hub / github.com/marimo-team/marimo / test_convert_ipynb

Method test_convert_ipynb

tests/_cli/test_cli_convert.py:72–102  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

70class TestConvert:
71 @staticmethod
72 def test_convert_ipynb(tmp_path: Path) -> None:
73 notebook_path = tmp_path / "test_notebook.ipynb"
74 notebook_content = """
75{
76 "cells": [
77 {
78 "cell_type": "code",
79 "execution_count": null,
80 "metadata": {},
81 "outputs": [],
82 "source": [
83 "print('Hello, World!')"
84 ]
85 }
86 ],
87 "metadata": {},
88 "nbformat": 4,
89 "nbformat_minor": 4
90}
91"""
92 notebook_path.write_text(notebook_content)
93
94 p = subprocess.run(
95 ["marimo", "convert", str(notebook_path)],
96 capture_output=True,
97 text=True,
98 )
99 assert p.returncode == 0, p.stderr
100 output = p.stdout
101 output = re.sub(r"__generated_with = .*", "", output)
102 snapshot("ipynb_to_marimo.txt", output)
103
104 @staticmethod
105 def test_convert_markdown(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 4

snapshotFunction · 0.85
subMethod · 0.80
write_textMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected