Example #1
0
 def test_suggest_when_cursor_on_word_amid(self):
     self.assertEqual(
         ["clone"],
         _find_suggestions(tree, ["pcs", "resource", "c", "add"], 2),
     )
Example #2
0
 def test_suggest_nothing_when_previously_typed_word_not_match(self):
     self.assertEqual(
         [], _find_suggestions(tree, ["pcs", "invalid", "c"], 2)
     )
Example #3
0
 def test_suggest_nothing_when_cursor_possition_out_of_range(self):
     self.assertEqual([], _find_suggestions(tree, ["pcs", "resource"], 3))
Example #4
0
 def test_suggest_when_last_word_started(self):
     self.assertEqual(
         ["clone"], _find_suggestions(tree, ["pcs", "resource", "c"], 2)
     )
Example #5
0
 def test_suggest_nothing_when_previously_typed_word_not_match(self):
     self.assertEqual([], _find_suggestions(tree, ['pcs', 'invalid', 'c'],
                                            2))
Example #6
0
 def test_suggest_nothing_when_cursor_on_first_word(self):
     self.assertEqual([], _find_suggestions(tree, ["pcs"], 0))
     self.assertEqual([], _find_suggestions(tree, ["pcs", "resource"], 0))
Example #7
0
 def test_suggest_when_last_word_started(self):
     self.assertEqual(["clone"],
                      _find_suggestions(tree, ['pcs', 'resource', 'c'], 2))
Example #8
0
 def test_suggest_when_cursor_on_word_amid(self):
     self.assertEqual(["clone"],
                      _find_suggestions(tree,
                                        ['pcs', 'resource', 'c', 'add'], 2))
Example #9
0
 def test_suggest_nothing_when_previously_typed_word_not_match(self):
     self.assertEqual(
         [],
         _find_suggestions(tree, ['pcs', 'invalid', 'c'], 2)
     )
Example #10
0
 def test_suggest_when_cursor_on_word_amid(self):
     self.assertEqual(
         ["clone"],
         _find_suggestions(tree, ['pcs', 'resource', 'c', 'add'], 2)
     )
Example #11
0
 def test_suggest_when_last_word_started(self):
     self.assertEqual(
         ["clone"],
         _find_suggestions(tree, ['pcs', 'resource', 'c'], 2)
     )
Example #12
0
 def test_suggest_nothing_when_cursor_possition_out_of_range(self):
     self.assertEqual([], _find_suggestions(tree, ['pcs', 'resource'], 3))
Example #13
0
 def test_suggest_nothing_when_cursor_on_first_word(self):
     self.assertEqual([], _find_suggestions(tree, ['pcs'], 0))
     self.assertEqual([], _find_suggestions(tree, ['pcs', 'resource'], 0))