Skip to content

Commit

Permalink
Add an 'example' prefix to the first notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Oct 31, 2022
1 parent f074ce3 commit 061e2fa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,21 +815,23 @@ def test_cli_sync_file_with_prefix_974(tmp_path, python_notebook):
"""
)

write(python_notebook, tmp_path / "notebook.ipynb")
write(python_notebook, tmp_path / "example_notebook.ipynb")
(tmp_path / "examples" / "folder1").mkdir(parents=True)
write(python_notebook, tmp_path / "examples/folder1/utils.py")
write(python_notebook, tmp_path / "examples/folder1/example_paired.ipynb")

jupytext(
[
"--sync",
str(tmp_path / "notebook.ipynb"),
str(tmp_path / "examples/folder1/example_paired.ipynb"),
str(tmp_path / "example_notebook.ipynb"),
str(tmp_path / "examples/folder1/utils.py"),
str(tmp_path / "examples/folder1/example_paired.ipynb"),
]
)

assert not (tmp_path / "notebook.py").exists(), "Not in the 'examples' directory"
assert not (
tmp_path / "example_notebook.py"
).exists(), "Not in the 'examples' directory"
assert not (
tmp_path / "examples/folder1/utils_not_paired.ipynb"
).exists(), "Not with the 'example' prefix"
Expand Down

0 comments on commit 061e2fa

Please sign in to comment.