[lang-ref] ( index_of_string_not_found ) ( python )
def test_index_of_string_not_found():
# -1 / exceptionh
text = 'abcdefghi abcdefghi'
s = 'DEF'
# find: return -1
assert text.find(s) == -1
# index: raise
with pytest.raises(ValueError):
text.index(s)