Skip to content

Commit 0afa1e5

Browse files
author
arovitn
committed
Modified to use list comprehension, added '()' for to_command_mode, added assert to check presence of cell and remove 'return True' from remove_cells
1 parent 70ce8fa commit 0afa1e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

notebook/tests/selenium/test_empty_arrows_keys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
def remove_cells(notebook):
55
for i in notebook.cells:
66
notebook.delete_cell(notebook.index(i))
7-
return True
87

98
def test_empty_arrows_keys(notebook):
109
# delete all the cells
1110
notebook.trigger_keydown('up')
1211
notebook.trigger_keydown('down')
13-
assert remove_cells(notebook);
12+
remove_cells(notebook)
13+
assert len(notebook.cells) == 1 # notebook should create one automatically on empty notebook

notebook/tests/selenium/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def add_cell(self, index=-1, cell_type="code", content=""):
186186

187187
def delete_cell(self, index):
188188
self.focus_cell(index)
189-
self.to_command_mode
189+
self.to_command_mode()
190190
self.current_cell.send_keys('dd')
191191

192192
def add_markdown_cell(self, index=-1, content="", render=True):
@@ -276,7 +276,7 @@ def trigger_keystrokes(browser, *keys):
276276
for each_key_combination in keys:
277277
keys = each_key_combination.split('-')
278278
if len(keys) > 1: # key has modifiers eg. control, alt, shift
279-
modifiers_keys = list(map(lambda x:getattr(Keys, x.upper()), keys[:-1]))
279+
modifiers_keys = [getattr(Keys, x.upper()) for x in keys[:-1]]
280280
ac = ActionChains(browser)
281281
for i in modifiers_keys: ac = ac.key_down(i)
282282
ac.send_keys(keys[-1])

0 commit comments

Comments
 (0)