def test_notebook_command():
def check_notebook_command(dirname):
project = project_no_dedicated_env(dirname)
command = project.default_command
assert command.notebook == 'test.ipynb'
assert command.unix_shell_commandline is None
assert command.windows_cmd_commandline is None
assert command.conda_app_entry is None
environ = minimal_environ(PROJECT_DIR=dirname)
cmd_exec = command.exec_info_for_environment(environ)
path = os.pathsep.join([environ['PROJECT_DIR'], environ['PATH']])
jupyter_notebook = find_executable('jupyter-notebook', path)
assert cmd_exec.args == [jupyter_notebook, os.path.join(dirname, 'test.ipynb'),
'--NotebookApp.default_url=/notebooks/test.ipynb']
assert cmd_exec.shell is False
with_directory_contents_completing_project_file(
{DEFAULT_PROJECT_FILENAME: "commands:\n default:\n notebook: test.ipynb\n"}, check_notebook_command)
评论列表
文章目录