示例#1
0
 def test_autocomplete_currently_matching(self):
     self.assertEqual("foo",
                      autocomplete.auto_complete("foo", ["foo", "foobar"]))
示例#2
0
 def test_autocomplete_empty(self):
     self.assertEqual("foo", autocomplete.auto_complete("foo", []))
示例#3
0
 def test_autocomplete(self):
     self.assertEqual(
         "foobar",
         autocomplete.auto_complete("foo",
                                    ["foobar1", "foobar2", "foobar3"]))
示例#4
0
 def test_autocomplete_containing_midword_matches(self):
     self.assertEqual(
         "fooba",
         autocomplete.auto_complete("fo",
                                    ["barfoobar", "foobar", "foobas"]))
示例#5
0
 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)