##// END OF EJS Templates
Add a test to catch when the path is empty
Jessica B. Hamrick -
Show More
@@ -105,3 +105,20 b' class TestExecute(PreprocessorTestsBase):'
105
105
106 else:
106 else:
107 self.assert_notebooks_equal(output_nb, input_nb)
107 self.assert_notebooks_equal(output_nb, input_nb)
108
109 def test_empty_path(self):
110 """Can the kernel be started when the path is empty?"""
111 current_dir = os.path.dirname(__file__)
112 filename = os.path.join(current_dir, 'files', 'HelloWorld.ipynb')
113 with io.open(filename) as f:
114 input_nb = nbformat.read(f, 4)
115 res = self.build_resources()
116 res['metadata']['path'] = ''
117 preprocessor = self.build_preprocessor()
118 cleaned_input_nb = copy.deepcopy(input_nb)
119 for cell in cleaned_input_nb.cells:
120 if 'execution_count' in cell:
121 del cell['execution_count']
122 cell['outputs'] = []
123 output_nb, _ = preprocessor(cleaned_input_nb, res)
124 self.assert_notebooks_equal(output_nb, input_nb)
General Comments 0
You need to be logged in to leave comments. Login now