def test_afw_completion(self):
""" Tests a correct afw completion comparing the language read,
that must be the same"""
original = copy.deepcopy(self.afw_completion_test_01)
AFW.afw_completion(self.afw_completion_test_01)
i = 0
last = 7
while i <= last:
base = list(itertools.repeat('a', i))
base += list(itertools.repeat('b', i))
# build all permutation of 'a' and 'b' till length i
word_set = set(itertools.permutations(base, i))
for word in word_set:
word = list(word)
original_acceptance = AFW.afw_word_acceptance(original, word)
completed_acceptance = AFW.afw_word_acceptance(
self.afw_completion_test_01, word)
self.assertEqual(original_acceptance, completed_acceptance)
i += 1
评论列表
文章目录