def test_error_update_not_ipynb(nb_file=list_notebooks()[0]): with pytest.raises(ValueError): cli_jupytext([nb_file, '--to', 'py', '--update'])
def test_error_no_ext(nb_file=list_notebooks()[0]): with pytest.raises(TypeError): cli_jupytext([nb_file])
def test_error_not_notebook_ext_output(nb_file=list_notebooks()[0]): with pytest.raises(TypeError): cli_jupytext([nb_file, '-o', 'not.ext'])
def test_cli_multiple_files(nb_files): assert cli_jupytext(nb_files + ['--to', 'py']).notebooks == nb_files
def test_cli_single_file(nb_file): assert cli_jupytext([nb_file] + ['--to', 'py']).notebooks == [nb_file]
def test_cli_no_argument(): with pytest.raises(ValueError): cli_jupytext([])