Esempio n. 1
0
 def test_suggest_when_cursor_on_word_amid(self):
     self.assertEqual(
         ["clone"],
         _find_suggestions(tree, ["pcs", "resource", "c", "add"], 2),
     )
Esempio n. 2
0
 def test_suggest_nothing_when_previously_typed_word_not_match(self):
     self.assertEqual(
         [], _find_suggestions(tree, ["pcs", "invalid", "c"], 2)
     )
Esempio n. 3
0
 def test_suggest_nothing_when_cursor_possition_out_of_range(self):
     self.assertEqual([], _find_suggestions(tree, ["pcs", "resource"], 3))
Esempio n. 4
0
 def test_suggest_when_last_word_started(self):
     self.assertEqual(
         ["clone"], _find_suggestions(tree, ["pcs", "resource", "c"], 2)
     )
Esempio n. 5
0
 def test_suggest_nothing_when_previously_typed_word_not_match(self):
     self.assertEqual([], _find_suggestions(tree, ['pcs', 'invalid', 'c'],
                                            2))
Esempio n. 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))
Esempio n. 7
0
 def test_suggest_when_last_word_started(self):
     self.assertEqual(["clone"],
                      _find_suggestions(tree, ['pcs', 'resource', 'c'], 2))
Esempio n. 8
0
 def test_suggest_when_cursor_on_word_amid(self):
     self.assertEqual(["clone"],
                      _find_suggestions(tree,
                                        ['pcs', 'resource', 'c', 'add'], 2))
Esempio n. 9
0
 def test_suggest_nothing_when_previously_typed_word_not_match(self):
     self.assertEqual(
         [],
         _find_suggestions(tree, ['pcs', 'invalid', 'c'], 2)
     )
Esempio n. 10
0
 def test_suggest_when_cursor_on_word_amid(self):
     self.assertEqual(
         ["clone"],
         _find_suggestions(tree, ['pcs', 'resource', 'c', 'add'], 2)
     )
Esempio n. 11
0
 def test_suggest_when_last_word_started(self):
     self.assertEqual(
         ["clone"],
         _find_suggestions(tree, ['pcs', 'resource', 'c'], 2)
     )
Esempio n. 12
0
 def test_suggest_nothing_when_cursor_possition_out_of_range(self):
     self.assertEqual([], _find_suggestions(tree, ['pcs', 'resource'], 3))
Esempio n. 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))