Vehicle-Anti-Theft-Face-Rec.../venv/Lib/site-packages/notebook/tests/selenium/test_prompt_numbers.py

31 lines
837 B
Python
Raw Normal View History

2020-11-12 16:05:57 +00:00
def test_prompt_numbers(prefill_notebook):
notebook = prefill_notebook(['print("a")'])
def get_prompt():
return (
notebook.cells[0].find_element_by_class_name('input')
.find_element_by_class_name('input_prompt')
.get_attribute('innerHTML').strip()
)
def set_prompt(value):
notebook.set_cell_input_prompt(0, value)
assert get_prompt() == "<bdi>In</bdi>&nbsp;[&nbsp;]:"
set_prompt(2)
assert get_prompt() == "<bdi>In</bdi>&nbsp;[2]:"
set_prompt(0)
assert get_prompt() == "<bdi>In</bdi>&nbsp;[0]:"
set_prompt("'*'")
assert get_prompt() == "<bdi>In</bdi>&nbsp;[*]:"
set_prompt("undefined")
assert get_prompt() == "<bdi>In</bdi>&nbsp;[&nbsp;]:"
set_prompt("null")
assert get_prompt() == "<bdi>In</bdi>&nbsp;[&nbsp;]:"