##// END OF EJS Templates
Add test for prompt numbers
Jessica B. Hamrick -
Show More
@@ -55,6 +55,10 class TestExecute(PreprocessorTestsBase):
55 55 normalized_actual_outputs = list(map(self.normalize_output, actual_outputs))
56 56 assert normalized_expected_outputs == normalized_actual_outputs
57 57
58 expected_prompt_number = expected_cell.get('prompt_number', None)
59 actual_prompt_number = actual_cell.get('prompt_number', None)
60 assert expected_prompt_number == actual_prompt_number
61
58 62
59 63 def build_preprocessor(self):
60 64 """Make an instance of a preprocessor"""
@@ -77,6 +81,10 class TestExecute(PreprocessorTestsBase):
77 81 input_nb = nbformat.read(f, 'ipynb')
78 82 res = self.build_resources()
79 83 preprocessor = self.build_preprocessor()
80 output_nb, _ = preprocessor(copy.deepcopy(input_nb), res)
84 cleaned_input_nb = copy.deepcopy(input_nb)
85 for cell in cleaned_input_nb.worksheets[0].cells:
86 if 'prompt_number' in cell:
87 del cell['prompt_number']
88 cell['outputs'] = []
89 output_nb, _ = preprocessor(cleaned_input_nb, res)
81 90 self.assert_notebooks_equal(output_nb, input_nb)
82
General Comments 0
You need to be logged in to leave comments. Login now