Exemple #1
0
def exec_commit(ctx, notebook):
    """Create a new notebook on Jovian

        $ jovian commit my_notebook.ipynb
    """
    if is_py2():
        log("Committing is not supported for Python 2.x. Please install and run Jovian from Python 3.6 and above.",
            warn=True)
    commit_path(path=notebook, environment=None, is_cli=True)
def test_commit_path(mock_commit, mock_sleep, ipynb_files, confirm,
                     expected_files):
    with mock.patch("jovian.utils.commit._list_ipynb_files",
                    return_value=ipynb_files) as mock_func:
        with mock.patch("click.confirm", return_value=confirm) as mock_confirm:
            commit_path(path="notebook", environment=None, is_cli=True)
            mock_commit.assert_has_calls([
                call(filename=f, environment=None, is_cli=True)
                for f in expected_files
            ])