Skip to content

Commit dcb45b2

Browse files
author
arovitn
committed
modified the deletion logic as per the comments and setting the readonly cell to false
1 parent 66b257b commit dcb45b2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

notebook/tests/selenium/test_deletecell.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ def cell_is_deletable(nb, index):
33
JS = 'return Jupyter.notebook.get_cell({}).is_deletable();'.format(index)
44
return nb.browser.execute_script(JS)
55

6-
def remove_cells(notebook):
7-
for i in notebook.cells:
8-
notebook.delete_cell(notebook.index(i))
6+
def remove_all_cells(notebook):
7+
for i in range(len(notebook.cells)):
8+
notebook.delete_cell(0)
99

1010
def test_delete_cells(notebook):
1111
a = 'print("a")'
@@ -56,5 +56,6 @@ def test_delete_cells(notebook):
5656
assert len(notebook.cells) == 2
5757
assert cell_is_deletable(notebook, 1)
5858

59-
remove_cells(notebook)
59+
notebook.set_cell_metadata(0, 'deletable', 'true') # to perform below test, remove all the cells
60+
remove_all_cells(notebook)
6061
assert len(notebook.cells) == 1 # notebook should create one automatically on empty notebook

0 commit comments

Comments
 (0)