Ejemplo n.º 1
0
 def test_multiple_words_ambigious_prefix(self) -> None:
     result = get_word_list_without_matching_word(self.word_list, "ch")
     self.assertTrue(
         any([
             result == ["alpha", "bravo", "charlie"],
             result == ["alpha", "bravo", "check"],
         ]))
Ejemplo n.º 2
0
 def test_single_word_exact_match(self) -> None:
     result = get_word_list_without_matching_word(["alpha"], "alpha")
     self.assertEqual(result, [])
Ejemplo n.º 3
0
 def test_missing_word_raises(self) -> None:
     with self.assertRaises(Exception):
         get_word_list_without_matching_word(self.word_list, "delta")
Ejemplo n.º 4
0
 def test_empty_list_raises(self) -> None:
     with self.assertRaises(Exception):
         get_word_list_without_matching_word([], "alpha")
Ejemplo n.º 5
0
 def test_multiple_words_unambigious_prefix(self) -> None:
     result = get_word_list_without_matching_word(self.word_list, "cha")
     self.assertEqual(result, ["alpha", "bravo", "check"])
Ejemplo n.º 6
0
 def test_multiple_words_prefix_match_end_of_list(self) -> None:
     result = get_word_list_without_matching_word(self.word_list, "che")
     self.assertEqual(result, ["alpha", "bravo", "charlie"])
Ejemplo n.º 7
0
 def test_multiple_words_exact_match_inside_list(self) -> None:
     result = get_word_list_without_matching_word(self.word_list, "bravo")
     self.assertEqual(result, ["alpha", "charlie", "check"])
Ejemplo n.º 8
0
 def test_multiple_words_prefix_match_start_of_list(self) -> None:
     result = get_word_list_without_matching_word(self.word_list, "al")
     self.assertEqual(result, ["bravo", "charlie", "check"])