From c8b59350527f1890a87491d8ba2db3b30a0c0437 2014-04-18 20:50:23 From: jon Date: 2014-04-18 20:50:23 Subject: [PATCH] Added a cwd test --- diff --git a/IPython/nbconvert/tests/files/hello.py b/IPython/nbconvert/tests/files/hello.py new file mode 100644 index 0000000..d161b00 --- /dev/null +++ b/IPython/nbconvert/tests/files/hello.py @@ -0,0 +1,7 @@ +from IPython.nbconvert.writers.base import WriterBase + +class HelloWriter(WriterBase): + + def write(self, output, resources, notebook_name=None, **kw): + with open('hello.txt', 'w') as outfile: + outfile.write('hello world') diff --git a/IPython/nbconvert/tests/test_nbconvertapp.py b/IPython/nbconvert/tests/test_nbconvertapp.py index a03c30a..9cb4388 100644 --- a/IPython/nbconvert/tests/test_nbconvertapp.py +++ b/IPython/nbconvert/tests/test_nbconvertapp.py @@ -200,3 +200,12 @@ class TestNbConvertApp(TestsBase): '--PDFPostProcessor.verbose=True') assert os.path.isfile(u'nb1_anĂ¡lisis.tex') assert os.path.isfile(u'nb1_anĂ¡lisis.pdf') + + def test_cwd_plugin(self): + """ + Verify that an extension in the cwd can be imported. + """ + with self.create_temp_cwd(['hello.py']): + self.create_empty_notebook(u'empty.ipynb') + self.call('nbconvert empty --to html --NbConvertApp.writer_class=\'hello.HelloWriter\'') + assert os.path.isfile(u'hello.txt')