From 9dabb31269e5845240736ca312b00ff134650a51 2013-08-05 21:44:00 From: Richard Everson Date: 2013-08-05 21:44:00 Subject: [PATCH] noteboook with spaces.ipynb test --- diff --git a/IPython/nbconvert/tests/test_nbconvertapp.py b/IPython/nbconvert/tests/test_nbconvertapp.py index 8649fc7..a01df1a 100644 --- a/IPython/nbconvert/tests/test_nbconvertapp.py +++ b/IPython/nbconvert/tests/test_nbconvertapp.py @@ -14,6 +14,8 @@ Contains tests for the nbconvertapp #----------------------------------------------------------------------------- import os +import glob + from .base import TestsBase from IPython.testing import decorators as dec @@ -74,6 +76,18 @@ class TestNbConvertApp(TestsBase): assert os.path.isfile('notebook2.py') + def test_filename_spaces(self): + """ + Are spaces removed from filenames? + """ + with self.create_temp_cwd(['notebook1.ipynb']): + os.rename('notebook1.ipynb', 'notebook with spaces.ipynb') + self.call('nbconvert --log-level=0 --to="latex" "notebook with spaces"') + assert os.path.isfile('notebook with spaces.tex') + assert os.path.isdir('notebook_with_spaces_files') + for f in glob.glob('notebook_with_spaces_files/*'): + assert r" \t\n" not in f + @dec.onlyif_cmds_exist('pdflatex') @dec.onlyif_cmds_exist('pandoc') def test_post_processor(self):