You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/notebook/tests/selenium/test_find_and_replace.py

17 lines
506 B

INITIAL_CELLS = ["hello", "hellohello", "abc", "ello"]
def test_find_and_replace(prefill_notebook):
""" test find and replace on all the cells """
notebook = prefill_notebook(INITIAL_CELLS)
find_str = "ello"
replace_str = "foo"
# replace the strings
notebook.find_and_replace(index=0, find_txt=find_str, replace_txt=replace_str)
# check content of the cells
assert notebook.get_cells_contents() == [
s.replace(find_str, replace_str) for s in INITIAL_CELLS
]