def test_autocomplete_currently_matching(self): self.assertEqual("foo", autocomplete.auto_complete("foo", ["foo", "foobar"]))
def test_autocomplete_empty(self): self.assertEqual("foo", autocomplete.auto_complete("foo", []))
def test_autocomplete(self): self.assertEqual( "foobar", autocomplete.auto_complete("foo", ["foobar1", "foobar2", "foobar3"]))
def test_autocomplete_containing_midword_matches(self): self.assertEqual( "fooba", autocomplete.auto_complete("fo", ["barfoobar", "foobar", "foobas"]))
def _auto_complete(self, current_search: str): auto_completion = autocomplete.auto_complete(current_search, self.mc.options) self.search_input_field.set_text(auto_completion) Gtk.Entry.do_move_cursor(self.search_input_field, 1, len(auto_completion), False)