Skip to content

Commit 205588f

Browse files
committed
Update tests.
1 parent 5c21220 commit 205588f

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

tests/test_notebook2script.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_process_multiple_notebooks(tmp_pathplus):
8080

8181
def test_convert_notebook(tmp_pathplus):
8282
notebook = tests_dir / "example_notebook.ipynb"
83-
outfile = tmp_pathplus / "output/example_notebook.py"
83+
outfile = tmp_pathplus / "output" / "example_notebook.py"
8484
convert_notebook(notebook, outfile)
8585
check_output(outfile)
8686

@@ -96,8 +96,30 @@ def test_cli(tmp_pathplus):
9696
args=[str(tests_dir / "example_notebook.ipynb"), "--outdir", str(outdir)],
9797
)
9898
assert result.exit_code == 0
99-
assert result.stdout == dedent(f"""\
99+
assert result.stdout == dedent(
100+
f"""\
100101
Converting {tests_dir}/example_notebook.ipynb to {tmp_pathplus}/output/example_notebook.py
101-
""")
102+
"""
103+
)
104+
105+
check_output(outdir / "example_notebook.py")
106+
107+
108+
def test_cli_glob(tmp_pathplus):
109+
outdir = tmp_pathplus / "output/"
110+
111+
with in_directory(tmp_pathplus):
112+
runner = CliRunner()
113+
result: Result = runner.invoke(
114+
main,
115+
catch_exceptions=False,
116+
args=[str(tests_dir / "*.ipynb"), "--outdir", str(outdir)],
117+
)
118+
assert result.exit_code == 0
119+
assert result.stdout == dedent(
120+
f"""\
121+
Converting {tests_dir}/example_notebook.ipynb to {tmp_pathplus}/output/example_notebook.py
122+
"""
123+
)
102124

103125
check_output(outdir / "example_notebook.py")

0 commit comments

Comments
 (0)